I got Jest
working in my environment, but I'm fairly certain that it's running way slower than it's supposed to.
Currently, I'm just running 2 tests that are copied from the Jest intro tutorials. One is a simple sum function, and another is a simple checkbox example using Enzyme
. They take on average about 10 seconds until they start running (showing Determining test suites to run...
for that time), and then about another 10 seconds from that point onwards (once the timer starts). This seems absurdly long for such simple components...
I tried setting my testEnvironment
to node
to speed things up, but it hasn't made much of a difference.
So accordingly:
1) Is this normal?
2) If not - what can cause Jest
to slow down like this?
Some potential factors?
1) I am running these tests within a larger React
project that contains ~20 or so react components, but none of them are being referenced by any of the tests - so I don't think they should be impacting this. =/
2) I'm using the fileName.test.js
naming system to let Jest
know where the test files are, instead of putting everything in a __tests__
folder as per the tutorials.