You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
copy the examples/getting-started to a new folder outside of Jest, so we can change the jest version freely.
goto this standalone getting-started folder
edit package.json to change the jest and babel-jest versions to 30.0.0-alpha.5
yarn install
run a specific test like this in a powershell terminal:
> yarn jest --testLocationInResults --testNamePattern "adds 1 \+ 2 to equal 3$" --no-coverage --colors --watchAll=false --testPathPatterns "c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js"
Expected behavior
Expect this to work just like with jest 29.x.
Edit package.json to update jest and babel-jest to 29.7.0; run yarn install then run the command again (replacing --TestPathPatterns with --TestPathPattern):
PS C:\Users\dev\github\open-source\getting-started> yarn jest --testLocationInResults --testNamePattern "adds 1 \+ 2 to equal 3$" --no-coverage --colors --watchAll=false --testPathPattern "c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js"
js";dbee3b2e-0ab6-4105-a99f-3a96e3b4cf5eyarn run v1.22.19 i
$ C:\Users\dev\github\open-source\getting-started\node_modules\.bin\jest --testLocationInResults --testNamePattern "adds 1 \+ 2 to equal 3$" --no-coverage --colors --watchAll=false --testPathPattern c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js
PASS ./sum.test.js
√ adds 1 + 2 to equal 3 (2 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.669 s, estimated 1 s
Ran all test suites matching /c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js/i with tests matching "adds 1 \+ 2 to equal 3$".
Done in 1.23s.
Actual behavior
the pattern match failed so no test is run:
PS C:\Users\dev\github\open-source\getting-started> yarn jest --testLocationInResults --testNamePattern "adds 1 \+ 2 to equal 3$" --no-coverage --colors --watchAll=false --testPathPatterns "c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js"
yarn run v1.22.19
$ C:\Users\dev\github\open-source\getting-started\node_modules\.bin\jest --testLocationInResults --testNamePattern "adds 1 \+ 2 to equal 3$" --no-coverage --colors --watchAll=false --testPathPatterns c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\Users\dev\github\open-source\getting-started
4 files checked.
testMatch: **/__tests__/**/*.?([mc])[jt]s?(x), **/?(*.)+(spec|test).?([mc])[jt]s?(x) - 1 match
testPathIgnorePatterns: \\node_modules\\ - 4 matches
testRegex: - 0 matches
Pattern: c:\\Users\\dev\\github\\open-source\\getting-started\\sum\.test\.js - 0 matches
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Additional context
This issue only occurs on Windows. It works as expected on macOS, as far as I can tell.
Also noticed jest seems to perform a case-insensitive match for TestPathPattern in v29.x. Can't tell if v30 is doing the same.
@SimenB, sorry to ping you again. This issue has blocked the release of our jest@30 support PR (jest-community/vscode-jest#1153). Has the path-regex-matching algorithm changed intentionally? The same path pattern is recognized in v29 but not in v30. If this is a breaking change in v30 and not a bug, please let us know the right path forward so we can fix the PR and start to support jest@30 users.
Version
30.0.0-alpha.5
Steps to reproduce
This can be demonstrated with jest's own
examples/getting-started
on a Window vscode powershell terminal:examples/getting-started
to a new folder outside of Jest, so we can change the jest version freely.getting-started
folderpackage.json
to change thejest
andbabel-jest
versions to30.0.0-alpha.5
Expected behavior
Expect this to work just like with jest 29.x.
Edit
package.jso
n to updatejest
andbabel-jest
to29.7.0
; runyarn install
then run the command again (replacing--TestPathPatterns
with--TestPathPattern
):Actual behavior
the pattern match failed so no test is run:
Additional context
Environment
The text was updated successfully, but these errors were encountered: