testMatch doesn't glob as expected
See original GitHub issuei’m setting up jest’s testMatch config, but it doesn’t glob as expected. my sanity-check command looks into the test folder relative to the project, goes to any depth, and selects any file that ends in .js:
ls ./test/**/*.js | wc -l
running that returns 92. which makes sense, i have 92 files in that directory structure (some tests and some test utils). but when i run jest with the same glob it says there are no tests found:
yarn run v1.9.4
$ jest --config jest.config.json
No tests found
In /Users/<user>/<repo>
460 files checked.
testMatch: ./test/**/*.js - 0 matches
testPathIgnorePatterns: /node_modules/ - 460 matches
Pattern: - 0 matches
error Command failed with exit code 1.
is this an issue with jest? with micromatch?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:14 (4 by maintainers)
Top Results From Across the Web
testMatch glob pattern unexpected behaviour - Stack Overflow
The glob patterns Jest uses to detect test files testMatch: [ '**/test/*.ts' ],. This isn't working as expected however.
Read more >Configuring Jest
Insert Jest's globals ( expect , test , describe , beforeEach etc.) into the global environment. If you set this to false ,...
Read more >Using Jest with Playwright
See here as a reference for the testRegex and testMatch setting. ... For every test beforeEach will create a new page as a...
Read more >Configuring Jest
An array of glob patterns indicating a set of files for which coverage ... See also testMatch [array<string>], but note that you cannot...
Read more >Investment Commentary Tax Efficient Wealth Management
expected returns and tax assumptions that ... the pre-tax expected return for global equity ... does not justify maintaining a suboptimal.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I too have problems with the
testMatch
globbing.Changing the built in:
to
will cause no files to be matches. To resolve this i have to:
Thanks!
We can look into why those globs don’t work - just wanted to verify that it’s the relative pathing