jest --watch
runs tests twice after chokidar accesses a file
#12498
Labels
Milestone
jest --watch
runs tests twice after chokidar accesses a file
#12498
Describe the problem and steps to reproduce it:
yarn test
in a shellyarn flow:dev
in another shellWhat happened?
Changing the file causes the tests to run twice.
What did you expect to happen?
The tests should only run once.
Anything else we should know?
It's happening because
chokidar
changes the file access time shortly after emitting a change event. I'm not sure why. Changing access time causes jest to re-run tests (see jestjs/jest#7124) which seems like a bug.I deduced it with something like this:
I was using the
p
filter injest
to only runTestAddonReviewCard.js
. Since this test suite is fast, it helped to see the flicker ofjest
running the tests twice.We fixed a separate (I think?) but related bug in #10514
The text was updated successfully, but these errors were encountered: