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

fix: refactor to prevent the tear down check issue #14

Merged
merged 1 commit into from Feb 14, 2022

Conversation

ValentinH
Copy link
Owner

@ValentinH ValentinH commented Feb 10, 2022

Fix #13

The "Test did not tear down" check logic has been a source of problems recently. This check was in place to ensure that some code in a test could not disable the whole failOnConsole() logic for the other tests. This was actually obsolete since #5 since we are now resetting the mechanism before each test: if one test somehow disables it, it will be enabled again in the next test.

While digging again in this code, I now understand that having the fail on console mechanism enabled in a beforeEach() and disabled in a afterEach() allows to simplify quite a lot the original logic. This is what this PR is about.

The code in this PR is published as 2.2.2-alpha.0 if you want to try it.

Copy link
Contributor

@KevinHerklotz KevinHerklotz left a comment

Choose a reason for hiding this comment

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

I just tested locally in one of my projects and it still works as expected 👍

@ValentinH ValentinH merged commit 122b489 into main Feb 14, 2022
@ValentinH ValentinH deleted the refactor-and-simplify branch February 14, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants