mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
fc13557d30c50517f5f1d369ce2ee02f506bb904
--- Remove jest fixture tests in favor of snap runner. Main reasons: - maintaining feature flags and compatible behavior required syncing all changes to 3 files (`generateTestsFromFixtures`, `compiler-test`, and `compiler-worker`) - jest snapshot test file causes rebase conflicts on most rebases - speed 🙌 $ time yarn test compiler-test (the extra test here is `has a consistent extension for input fixtures`) ``` Test Suites: 1 passed, 1 total Tests: 37 skipped, 480 passed, 517 total Snapshots: 479 passed, 479 total Time: 27.668 s Ran all test suites matching /compiler-test/i. ✨ Done in 43.18s. yarn test compiler-test 57.05s user 3.85s system 139% cpu 43.546 total ``` $ time yarn snap ``` 478 Tests, 478 Passed, 0 Failed ✨ Done in 13.12s. yarn snap 53.96s user 9.35s system 468% cpu 13.518 total ``` Jest and snap should have the same set of features: - report test failures via exit status (used by Git Actions) - watch mode - breakpoints + `debugger` statements - note that `--sync` is not required for this - skip `todo.` prefixed fixtures - fixtures in nested directories e.g. `rules-of-hooks/testname.js` - filter mode (via editing `testfilter.txt`) - filter + debug mode (1) edit `testfilter.txt` to filter out all but one test (2) add `@debug` pragma to the first line of the test testfilter.txt ```js // @only testfixture_basename1 testfixture_basename2 ```
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%