Jest --findRelatedTests flag not finding related test

Viewed 262

Running the CLI command yarn run jest --findRelatedTests src/components/Banner.js in my environment doesn't run the corresponding test Banner.test.js located in the __tests__ folder in the same directory. Why would this happen? Output of the command:

Run with `--passWithNoTests` to exit with code 0
No files found in...
...
Pattern: src/components/Banner.js - 0 matches

Jest config also doesn't have any rootDir or roots specified which I presume could affect it.

For reference, the directory structure is:

src/components
    __tests__
        Banner.test.js
    Banner.js

yarn run jest works as expected on all tests.

0 Answers
Related