jest: Jest v26 is failing when run without cli options
š 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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (7 by maintainers)
Commits related to this issue
- Fix locale issue #10014 (#11412) — committed to jestjs/jest by rasgele 3 years ago
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
Thanks @rasgele you have solved my problem as well just by changing some region settings. Ä°yi gĆ¼nler! š
I changed my language and it worked for me. sad but true.
Just created an issue in
camelcase
project as well.seems like we should pass
locale
tocamelcase
- anyone up for sending a PR?Adding the locale environment to test script works. You can update your test command in package.json
Well I had to make a little change at built js files: From: To: I couldnāt find where are the args. coming from but I think they are from yarn(I didnāt even install yarn so I donāt know). But hey! At least it works very well š
I am experiencing same issue. I have created empty folder (no js files and other stuff) to verify thatās not because of another something