Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(console): export helper to manually suppress error output #571

Merged
merged 5 commits into from Mar 1, 2021

Conversation

mpeyper
Copy link
Member

@mpeyper mpeyper commented Mar 1, 2021

What:

Add a helper to suppress the error output in the same way the automatic suppression does for users that can't use the automatic version.

Also extended the documentation around this feature to describe the requirements for automatic suppression and give instructions on how to do it manually.

Why:

#564

How:

extracted the logic from the beforeEach and afterEach and exported them from all the modules.

Checklist:

  • Documentation updated
  • Tests
  • Ready to be merged

})

test('should not patch console.error', () => {
require('..')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually wasn't testing anything. Requiring in the test wouldn't register the beforeEach and afterEach so it must be done before the test executes. I discovered this because with the refactoring, this left a uncovered branch that is now covered.

@codecov
Copy link

codecov bot commented Mar 1, 2021

Codecov Report

Merging #571 (a2c10f9) into master (7f6e4bb) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #571   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          218       219    +1     
  Branches        31        29    -2     
=========================================
+ Hits           218       219    +1     
Impacted Files Coverage Δ
src/core/index.ts 100.00% <ø> (ø)
src/dom/pure.ts 100.00% <ø> (ø)
src/native/pure.ts 100.00% <ø> (ø)
src/server/pure.ts 100.00% <ø> (ø)
src/core/console.ts 100.00% <100.00%> (ø)
src/pure.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f6e4bb...63becef. Read the comment docs.

@mpeyper mpeyper requested a review from joshuaellis March 1, 2021 11:49
Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, documentation is clear as well 👍🏼

@joshuaellis joshuaellis merged commit d8dac20 into master Mar 1, 2021
@github-actions
Copy link

github-actions bot commented Mar 1, 2021

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants