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
When I want to run one of them from command line, jest crashed.
To Reproduce
Steps to reproduce the behavior:
run npx jest 1
Expected behavior
Jest run tests matched by 1.
It worked on macOS, but not Windows.
Actual behavior
Output:
TypeError: pattern.replace is not a function
at replacePosixSep (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\jest-config\build\normalize.js:591:20)
at Array.map (<anonymous>)
at buildTestPathPattern (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\jest-config\build\normalize.js:594:36)
at normalize (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\jest-config\build\normalize.js:1119:32)
at readConfig (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\jest-config\build\index.js:220:68)
at async readConfigs (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\jest-config\build\index.js:401:26)
at async runCLI (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\@jest\core\build\cli\index.js:203:59)
at async Object.run (C:\Users\Simon\Desktop\leetcode-solutions\node_modules\jest\node_modules\jest-cli\build\cli\index.js:216:37)
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.
🐛 Bug Report
I have test files named by numbers.
When I want to run one of them from command line, jest crashed.
To Reproduce
Steps to reproduce the behavior:
npx jest 1
Expected behavior
Jest run tests matched by
1
.It worked on macOS, but not Windows.
Actual behavior
Output:
https://github.com/facebook/jest/blob/5dcc48075f22d581864f381f20bc8b257d2a73cd/packages/jest-config/src/normalize.ts#L419-L426
Looks like
yargs
will parse the1
as a number, thusNumber.prototype.replace
isundefined
.Link to repl or repo (highly encouraged)
I believe it can be reproduced in any repo, even if you do not have a test named
1
.envinfo
The text was updated successfully, but these errors were encountered: