-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Migration of tests to Jest #6565
Conversation
used regexps: ([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\.should\.be\.eql ➡️ expect($1).toBe expect\(([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\)\.toBe\(\[ ➡️ expect($1).toEqual([ expect\(([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\)\.toBe\(\{ ➡️ expect($1).toEqual({
\.to\.have\.property\((.+)\)\.toEqual\((.+)\); ➡️ .toHaveProperty($1, $2);
Convert tests to Jest
# Conflicts: # test/BenchmarkTestCases.benchmark.js # test/CachePlugin.unittest.js # test/HotTestCases.test.js # test/NormalModule.unittest.js # test/ProfilingPlugin.unittest.js # test/TestCases.test.js # test/configCases/parsing/harmony-this/index.js # test/configCases/plugins/profiling-plugin/index.js # test/configCases/plugins/profiling-plugin/webpack.config.js # test/watchCases/runtime/static-import/0/index.js # yarn.lock
elsewise haste map generation takes forever with many files in folder
Looks good, I noticed one small issue. When running jest in watch mode and running the WatchDetection test, sane emits EPERM errors on windows. |
# Conflicts: # test/WatchTestCases.test.js
@sokra Thanks for your update. I labeled the Pull Request so reviewers will review it again. @shellscape Please review the new changes. |
Awesome thanks |
Awesome stuff @niieani ! Thanks @skovhus for /~https://github.com/skovhus/jest-codemods 🙌 Just throwing it out there: But then I wrote a (seriously) toned down version focusing on assertions that babel's tests required at: /~https://github.com/devenbansod/jest-expect-codemod |
I got this random error in watch mode after changing a file. Can't reproduce...
|
@niieani What's the reason for using |
I also ran into this issue jestjs/jest#4820 but no blocker |
It's worse than I original estimated. The whole jest watch process crashes. Please handle the |
@sokra Not sure what to do with the Windows issues, I'm on macOS. :/ |
@ooflorent Alright, I've done it.
This is with
jest
:This was before on the same computer with
mocha
:That's an improvement of almost 6x in terms of speed.
(fewer total number of tests under Mocha, cause I run that test around 4.0-alpha, before merging current master)