Jest v26 is failing when run without cli options
See original GitHub issueš Bug Report
When running the jest without cli options, itās failing.
receiving following message in console
> jest
ā Unrecognized CLI Parameters:
Following options were not recognized:
["run-in-band", "test-location-in-results"]
CLI Options Documentation:
https://jestjs.io/docs/en/cli.html
npm ERR! Test failed. See above for more details.
Problem is with version 26.0.1 (and 26.0.0). Same scenario is working with version 25.5.4.
To Reproduce
Followed the docs of jest. https://jestjs.io/docs/en/getting-started
Expected behavior
When no option is set, it is expected to run all tests.
Link to repl or repo (highly encouraged)
https://github.com/basarbk/jest-without-params-fail
envinfo
System: OS: Windows 10 10.0.10240 CPU: (4) x64 IntelĀ® Coreā¢ i5-6300U CPU @ 2.40GHz Binaries: Node: 12.13.1 - C:\Program Files\nodejs\node.EXE npm: 6.13.1 - C:\Program Files\nodejs\npm.CMD npmPackages: jest: ^26.0.1 => 26.0.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (3 by maintainers)
Top Results From Across the Web
Jest CLI Options
The jest command line runner has a number of useful options. You can run jest --help to view all available options. Many of...
Read more >Jest tests run through CLI but fail through Visual Studio 2019 ...
Since Jest runs without problems from the command line, this means there is something different when the tests a re run through Visual...
Read more >jest-preset-angular - npm
Jest doesn't run in browser nor through dev server. It uses jsdom to abstract browser environment. So we have to cheat a little...
Read more >How I Fixed The Unexpected Token Error In Jest
Not one bit. The "issue" is that Jest only wants to process CommonJS-style code. So for the Jest tests to run, it first...
Read more >Stencil: Jest 27 Upgrade Instructions - Ionic Blog
Next, upgrade Jest. The command below assumes your project uses Jest v26. If you're using an older version of Jest, it's recommended that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Iāve experienced same. Problems is with host locale and
camelcase
dependency.validateCLIOptions
method injest-validate\build\validateCLIOptions.js
callscamelcase
for eachargv
and tries to match them with allowed options. (see [this] line)(https://github.com/facebook/jest/blob/63ebaa6e3848ddf228b1acc6f870c7eaca34e46c/packages/jest-validate/src/validateCLIOptions.ts#L81) When it callscamelcase
for argrun-in-band
,camelcase
returnsrunÄ°nBand
(capital āiā in Turkish) if host has ātr-TRā locale. AndrunÄ°nBand
is not one of allowed options (althoughrunInBand
is).Workaround for Win10: Settings > Region & Language > Adminstrative language settings > Formats. Set Format to English (United States). That changes locale of node to en-US.
I guess proper solution would be
camelcase
providing locale option and jest-validate just providesen-US
as locale.In
package.json
, adding--runInBand
option is also a legit workaround for the time being. Adding that, the options wonāt be added behind the scene, and there will be no Turkish char problem:But expect a longer time to complete as it runs tests one by one