Open DaveStein opened 6 years ago
@thymikee thoughts?
Does it happen on latest jest too? I'd need to take a closer look if this is a micromatch bug or something we escape maybe.
Updated.
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.6.0 => 23.6.0
Line 98 of Defaults.js
:
testMatch: ['**/?(*.)+(test).js'],
= found tests
testMatch: ['**/?(*.)+test.js']
= same bug
I copy pasted from the file, rather than deleting the parenthesis in this comment just to be super paranoid.
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.
.
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
,
It seems that 'testMatch' in config doesn't work at all (at least with ts-jest).
Adding default value from documentation:
'testMatch': [ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ],
give this output:
16 files checked.
testMatch: src/__tests__/*.spec.ts - 0 matches
testPathIgnorePatterns: /node_modules/ - 16 matches
testRegex: - 0 matches
Pattern: - 0 matches
🐛 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
Link to repl or repo (highly encouraged)
N/A
Run
npx envinfo --preset jest
Paste the results here: