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
Run npx jest --findRelatedTests src/example.js and see the following:
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
No files found in ~/github/jest-find-related-tests-roots.
Make sure Jest's configuration does not exclude this directory.
To set up Jest, make sure a package.json file exists.
Jest Documentation: https://jestjs.io/docs/configuration
Pattern: src/example.js - 0 matches
Expected behavior
PASS test/example.test.js
✓ should provide 42 (2 ms)
After reading the docs on roots, I think this works as designed. I've implemented a fix in Stryker (add the directory of the file under test to "roots" before each run).
Note: While rootDir is mostly used as a token to be re-used in other configuration options, roots is used by the internals of Jest to locate test files and source files. This applies also when searching for manual mocks for modules from node_modules (__mocks__ will need to live in one of the roots).
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🐛 Bug Report
Using
--findRelatedTest
doesn't seem to be compatible with specifyingroots
.To Reproduce
Steps to reproduce the behavior:
roots
to point to your test dirnpx jest --findRelatedTests src/example.js
and see the following:Expected behavior
Link to repl or repo (highly encouraged)
See https://github.com/nicojs/jest-find-related-tests-roots for an example.
envinfo
The text was updated successfully, but these errors were encountered: