-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
Version
27.0.6
Steps to reproduce
- Clone the repo at https://github.com/kettanaito/jest-nm-issue
yarn installyarn test
Expected behavior
Jest detects the node_modules/__test/example.test.js file and runs it.
The file matches the testMatch pattern, which you can confirm by clicking on that pattern in the terminal and being navigated to the correct existing directory (tested in VS Code).
Actual behavior
$ jest
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /Users/kettanaito/Projects/contrib/jest-nm-issue
2 files checked.
testMatch: /Users/kettanaito/Projects/contrib/jest-nm-issue/node_modules/__test/*.test.js - 0 matches
testPathIgnorePatterns: not_node_modules - 2 matches
testRegex: - 0 matches
Pattern: - 0 matches
0 matchesnext to the correct pattern pointing to an existing directory undernode_modulesis not expected.
Additional context
I distribute a test suite as a node module because it acts as a specification for multiple projects. I wish to run that test suite from the node_modules where it's installed.
Regardless of my setup, it's confusing that Jest seems to ignore anything as long as it includes "node_modules" even if I've explicitly whitelisted a certain directory in it.
Environment
System:
OS: macOS 11.5.1
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Binaries:
Node: 12.18.2 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
npmPackages:
jest: ^27.0.6 => 27.0.6tomalec and ashleykolodziej