You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling aberlaas test --watch ./deep/directory correctly runs tests relative to ./deep/directory and re-runs them whenever a file is changed in ./deep/directory...
...but it also reloads the tests whenever a file in changes in ./foo/bar as well.
I played with various Jest options, but couldn't really understand why it was acting that way. The error is especially visible when running a monorepo and watching tests in one module, and editing files in another module will reload the files.
A hackish way to fix this would be to detect when specific files are passed aberlaas test and extract the list of dirnames in which those files are set. Then, we manually add any other directory to watchPathIgnorePatterns to manually force jest to ignore directories where there is no files to check.
The text was updated successfully, but these errors were encountered:
This issue seems to not be one. It seems that Jest was actually outsmarting me and reloading the tests because I was changing a file that was included in the dependency tree.
For the monorepo issue mentioned, I found a better way to run the test:watch in that context by using something akin to the hack I mentioned above. So closing it.
Calling
aberlaas test --watch ./deep/directory
correctly runs tests relative to./deep/directory
and re-runs them whenever a file is changed in./deep/directory
......but it also reloads the tests whenever a file in changes in
./foo/bar
as well.I played with various Jest options, but couldn't really understand why it was acting that way. The error is especially visible when running a monorepo and watching tests in one module, and editing files in another module will reload the files.
A hackish way to fix this would be to detect when specific files are passed
aberlaas test
and extract the list of dirnames in which those files are set. Then, we manually add any other directory towatchPathIgnorePatterns
to manually force jest to ignore directories where there is no files to check.The text was updated successfully, but these errors were encountered: