Prevent spurious extra errors in e2e tests when before* fails #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, when browser initialization in a before* block of an e2e test fails, Jest would still try to run all the corresponding tests and after* methods, and you'd get a bunch of noise in the test logs unrelated to the real error.
This PR:
test
/it
bodies from running after abeforeEach
/beforeAll
failure by switching our testRunner from the default (jasmine) to jest-circus per Jest team's recommendation at Tests are run even when beforeAll throws error jestjs/jest#2713afterEach
/afterAll
failures after abeforeEach
/beforeAll
failure by adding defensive checks to all our e2e tests' after* methods to prevent them from trying to close browser instances that weren't successfully constructedThe results are that if a browser-initialization error happens, you'll see exactly 1 error per test suite (in beforeAll initialization cases) or per test (in beforeEach initialization cases), as expected.