jest icon indicating copy to clipboard operation
jest copied to clipboard

watch mode regex is not working

Open unional opened this issue 4 years ago • 10 comments

🐛 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.

unional avatar Feb 07 '20 01:02 unional

Active Filters: filename /globalprotect\.\*multi/

From this printout, seems like the regex is being escaped.

unional avatar Feb 07 '20 01:02 unional

Can reproduce:

in a repo with test files that include:

AutoComplete.spec.tsx
Popover.spec.tsx
PersonAutoComplete.spec.tsx

do:

  1. jest --watch

  2. hit p, then type pop|auto:

    Screen Shot 2020-04-16 at 4 22 05 PM

    you'll see the expected results.

  3. hit enter to run tests

EXPECTED: tests run ACTUAL: get "no tests found" message:

Screen Shot 2020-04-16 at 4 22 11 PM

chadlavi avatar Apr 16 '20 20:04 chadlavi

+1

AaronRobinson avatar Apr 15 '21 06:04 AaronRobinson

+1

EllaSharakanski avatar May 18 '21 17:05 EllaSharakanski

  • 1

tiennguyen1293 avatar Jul 08 '21 04:07 tiennguyen1293

Hi guys i think we can use jest-watch-typeahead

tiennguyen1293 avatar Jul 08 '21 04:07 tiennguyen1293

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.

morzel85 avatar Jul 14 '21 12:07 morzel85

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.

github-actions[bot] avatar Feb 17 '23 16:02 github-actions[bot]

This problem still exists in 29.4.2

unional avatar Feb 17 '23 19:02 unional

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.

github-actions[bot] avatar Feb 17 '24 20:02 github-actions[bot]

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.

github-actions[bot] avatar Mar 18 '24 20:03 github-actions[bot]

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.

github-actions[bot] avatar Apr 18 '24 00:04 github-actions[bot]