Seems to be much slower than Mocha
See original GitHub issueI currently use a testing setup for my projects that uses Mocha, ts-node, and nyc. In several of them I’ve tried switching to Jest. But ts-jest is consistently significantly slower 😢
I’ve added Jest to this project where you can see the difference.
These are the times I’m seeing in the project:
- Current setup:
time npm test
4.05 seconds - Jest:
time npm run test-jest
12.34 seconds
Note that my tests themselves takes about 3-4 seconds. So Mocha adds a very small overhead where Jest is noticeably slower. I’ve tried in larger projects as well where the difference is even bigger.
For your convenience, here are the commands to reproduce:
git clone https://github.com/funkia/list
cd list
npm install
time npm test
time npm run test-jest
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:18 (12 by maintainers)
Top Results From Across the Web
Jest runs 40 times slower than mocha - Stack Overflow
I'm currently setting it up mocha to work with typescript, and so far it's not very fast - it's freaking instantaneous. · Comparing...
Read more >Terrible performance in Mocha Pro 2022 9.0.1 and After ...
Like you say, it seems like AE is sending the frames to Mocha slower than it should compared to AE 2021 and prior....
Read more >[AskJS] Jest is so slow. Why Jest? : r/javascript - Reddit
We did a quick Mocha test, and it worked great. 0.4 seconds. Then I mentioned that the other big framework was Jest, but...
Read more >Mocha plugin is extremely slow and sometimes crash...
When I launch Mocha, it takes a long time to load the footage (about 20 to 30 seconds). Then once it does load,...
Read more >Speeding Up Your JavaScript Test Suite - Atomic Spin
Having fast tests is important. Slow running tests slow down development, especially if you're practicing TDD. If tests are too slow to run, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve posted a question on stackoverflow to see if we can get some help on this
Guess there’s nothing more we can do here then.