question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Huge increase in test time since upgraded to jest 24 and new preset

See original GitHub issue

Hi there, we have a medium sized project with around 1600 tests.

We upgraded yesterday to jest 24 with new preset, with recommended migrations changes. We use jsdom 13 as stated in the migration guide.

Please note no change was made to our project. On the same machine, here are the speed reports. It was run with jest alone, and reported result is the second launch of jest command (to ensure no cache problem or something like that).

Before, under jest 23:

Test Suites: 11 skipped, 169 passed, 169 of 180 total
Tests:       82 skipped, 1671 passed, 1753 total
Snapshots:   0 total
Time:        19.142s

After upgrading to new preset 7.0.1 and jest 24:

Test Suites: 11 skipped, 169 passed, 169 of 180 total
Tests:       82 skipped, 1671 passed, 1753 total
Snapshots:   0 total
Time:        29.138s

Attempt with jest 24 and old 6.0.2 preset (no jsdom 13):

Test Suites: 11 skipped, 169 passed, 169 of 180 total
Tests:       82 skipped, 1671 passed, 1753 total
Snapshots:   0 total
Time:        25.061s

Please note it’s especially components which encounter that problem. Our most complete component went from 2s testing under jest 23 to more than 8 sec itself alone in jest 24/preset 7.0.2.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Ludevikcommented, May 17, 2019

@blackholegalaxy tests in my project were super slow after upgrade too, but i enabled isolatedModules in ts-jest options and they were back to normal. See this link. It might help you, but it has its costs.

0reactions
blackholegalaxycommented, Sep 20, 2019

In our case it didn’t change much. 2 seconds average on a 45s run basis. The fact is with jest 24+, we have like… 10 seconds where NOTHING happens. Then tests start normally. Even with test cache enabled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest 24 is slower than Jest 23.6.0 on the same test suite #7811
Jest v24 takes 38 seconds vs v23 28 seconds to run 50 suites (296 tests). ... This is with 1400 tests on a...
Read more >
Jest 24: Refreshing, Polished, TypeScript-friendly
It's been 4 months since the last minor release, and 8 months since Jest 23, so this upgrade is a big one, with...
Read more >
javascript - Jest - Simple tests are slow - Stack Overflow
In my case I upgraded the jest version, started using --watch and --runInBand and running on my host instead of via docker, and...
Read more >
How to make your sluggish Jest tests go faster - ITNEXT
A step-by-step guide how to improve performance of your slow Jest unit test and make them blazingly fast and delightful again.
Read more >
Jest Testing like a Pro - Tips and tricks
A (long) summary of best practices and tips to test your code with Jest. ... and tricks that can hopefully save you some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found