Rework snapshot matcher to support parallel mocha#5813
Conversation
|
@bajtos Please fix code formatting. |
|
|
Fair enough.
I am not comfortable with using Let's use |
aba0a64 to
f7d26cf
Compare
|
I rebased the patch on top of the latest master, addressed review comments and made few more improvements/cleanups:
@raymondfeng I consider the PR as ready for final review, PTAL. |
|
(I'll clean up the commit history before merging.) |
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
…sting - For each snapshotDir, share the same instance of snapshot matcher - Use Mocha root hooks to inject the current test, reset snapshot matchers and update snapshot files. - Add .mocharc.js for packages/cli to register root hooks Co-Authored-By: Miroslav Bajtoš <mbajtoss@gmail.com>
f7d26cf to
e16d378
Compare
Extracted from #5011 to land the changes in isolation from the actual enablement of parallel testing.
The first commit is cherry-picked 20da28e, then I added more commits to clean up the code more to my liking.
My intention is to further clean up the commit history once we agree on the implementation direction & details.
To verify parallel tests, one can run the test suite via
npm test -- --parallel. Some of the tests are failing in parallel mode on a timeout, I think that's something to investigate as part of enabling parallel mode (outside of this PR).Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈