jest
jest copied to clipboard
watch mode regex is not working
🐛 Bug Report
From typeahead, you can see the pattern correctly filtered to a list of files.
Pattern Mode Usage
› Press Esc to exit pattern mode.
› Press Enter to filter by a filenames regex pattern.
pattern › globalprotect.*multi
Pattern matches 8 files
› src/restapi/network/GlobalProtectClientlessAppGroups.multi.accept.ts
› src/restapi/network/GlobalProtectClientlessApps.multi.accept.ts
› src/restapi/network/GlobalProtectGateways.multi.accept.ts
› src/restapi/network/GlobalProtectIPSecCryptoNetworkProfiles.multi.accept.ts
› src/restapi/network/GlobalProtectMDMServers.multi.accept.ts
› src/restapi/network/GlobalProtectPortals.multi.accept.ts
› src/restapi/objects/GlobalProtectHipObjects.multi.accept.ts
› src/restapi/objects/GlobalProtectHipProfiles.multi.accept.ts
But when I press enter,
No tests found, exiting with code 0
Watch Usage: Press w to show more.
Active Filters: filename /globalprotect\.\*multi/
› Press c to clear filters.
Watch Usage
› Press a to run all tests.
› Press f to run only failed tests.
› Press o to only run tests related to changed files.
› Press q to quit watch mode.
› Press b to turn on bailing at first error.
› Press e to turn on code coverage collection.
› Press n to start continue mode.
› Press p to filter by a filename regex pattern.
› Press r to repeat test runs.
› Press R to randomly pick some test suites to run.
› Press s to suspend watch mode.
› Press t to filter by a test name regex pattern.
› Press v to turn on test verbosity.
› Press Enter to trigger a test run.
Expected behavior
Those selected test files will be executed.
Link to repl or repo (highly encouraged)
these are some internal code, so no repo is available. sorry. :(
envinfo
$ npx envinfo
npx: installed 1 in 1.626s
System:
OS: Windows Server 2016 10.0.14393
CPU: (56) x64 Intel(R) Xeon(R) CPU E5-4650 v4 @ 2.20GHz
Memory: 175.23 GB / 255.78 GB
Binaries:
Node: 12.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files\nodejs\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Managers:
Composer: 1.9.0 - C:\ProgramData\ComposerSetup\bin\composer.BAT
pip2: 9.0.1 - C:\Python27\Scripts\pip2.EXE
Utilities:
Git: 2.15.1. - /mingw64/bin/git
IDEs:
VSCode: 1.41.1 - D:\hwong\Microsoft VS Code\bin\code.CMD
Languages:
Bash: 4.4.12 - C:\Program Files\Git\usr\bin\bash.EXE
Go: 1.9.3 - C:\Go\bin\go.EXE
Perl: 5.24.1 - C:\Program Files\Git\usr\bin\perl.EXE
PHP: 7.4.1 - C:\php\php.EXE
Python: 2.7.14 - /c/Python27/python
Browsers:
Internet Explorer: 11.0.14393.2007
I'm pretty sure it was working a while back, but I don't have the exact jest version. Something before 24.9.0
I was doing filtering like these daily.
Active Filters: filename /globalprotect\.\*multi/
From this printout, seems like the regex is being escaped.
Can reproduce:
in a repo with test files that include:
AutoComplete.spec.tsx
Popover.spec.tsx
PersonAutoComplete.spec.tsx
do:
-
jest --watch
-
hit
p
, then typepop|auto
:you'll see the expected results.
-
hit enter to run tests
EXPECTED: tests run ACTUAL: get "no tests found" message:
![Screen Shot 2020-04-16 at 4 22 11 PM](https://user-images.githubusercontent.com/7226642/79503098-9a938000-7ffe-11ea-988f-50bd2467047b.png)
+1
+1
- 1
Hi guys i think we can use jest-watch-typeahead
I'm facing the same issue. While I start to type a file pattern, regexp works correctly to find matching files but when I press enter to trigger test run then the regexp gets escaped and there are no matches.
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.
This problem still exists in 29.4.2
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.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.