'Improving Jest testMatch pattern matcher
I am using Jest and using this 'testMatch' pattern to match my test files inside jest.config.js:
testMatch: ['**/?(*.)+(spec).[j|t]s?(x)']
But it is incorrectly picking up some files that end in spec.js. I would like it to only match .spec.js but anything I try results in no files being found.
This regular expression seems to do what I want /.*\.spec\.[j|t]sx?/ but I think these pattern matchers work slightly differently
What do I have to change to make it only pick up [something].spec.js files (or jsx/ts/tsx)?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
