testMatch not working as expected
See original GitHub issue🐛 Bug Report
The regex is not working as I expected within testMatch
argument.
To Reproduce
Steps to reproduce the behavior:
I thought I was passing the argument incorrectly via CLI so I started messing with the defaults in jest itself and found something odd.
If I change the default testMatch
to this, it still works: testMatch: ['**/?(*.)+(test).js'],
If I change it to this, it finds no tests: testMatch: ['**/?(*.)+test.js'],
Expected behavior
I would expect this to work, without adding a capturing group
In [REMOVED]
107 files checked.
testMatch: **/?(*.)+test.js - 0 matches
testPathIgnorePatterns: /node_modules/ - 107 matches
Pattern: - 0 matches
Link to repl or repo (highly encouraged)
N/A
Run npx envinfo --preset jest
Paste the results here:
System:
OS: macOS High Sierra 10.13.3
CPU: x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
Binaries:
Node: 8.10.0 - /usr/local/bin/node
npm: 6.1.0 - /usr/local/bin/npm
npmPackages:
jest: ^23.3.0 => 23.4.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
testMatch doesn't glob as expected · Issue #7108 · facebook/jest
i'm setting up jest's testMatch config, but it doesn't glob as expected. my ... I too have problems with the testMatch globbing.
Read more >Jest No Tests found - Stack Overflow
I wrote a test, not in the specific folder and follow a naming convention *.test.js and change testMatch "testMatch": [ "<rootDir>/src/**/*.
Read more >Jest — Filenames without test or spec | by Damian Myerscough
js file as a test file and run the tests within that file. I used the following command to achive this. ❯ jest...
Read more >Configuring Jest
Please keep in mind that the resulting configuration must be JSON-serializable. When using the --config option, the JSON file must not contain a...
Read more >Test Match Playing Conditions - ESPNcricinfo
Play shall not take place on more than 5 days. ... subject to there being 6 hours scheduled for play per day (Pakistan...
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
Similar: https://github.com/facebook/jest/issues/7441 and https://github.com/facebook/create-react-app/issues/5935
.