Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix locale issue #10014 #11412

Merged
merged 2 commits into from
May 16, 2021
Merged

Fix locale issue #10014 #11412

merged 2 commits into from
May 16, 2021

Conversation

vozzen
Copy link
Contributor

@vozzen vozzen commented May 14, 2021

Summary

Fixes #10004.

As described in this comment, jest fails while running at machines with some non-English locales, like Turkish.

This PR uses new camelcase version that offers a locale option to use while converting case, which makes default locale irrelevant; hence eliminates the problem.

Changes:

  • Upgrade camelcase version for jest-validate workspace.
  • Call camelcase function providing en-US as locale while validating CLI options.

Test plan

Problem reproducible at machines using some certain locale. Following execution is on a Turkish locale machine:

D:\src\jest-test  ([email protected])
λ
node D:\src\jest\packages\jest-cli\bin\jest.js
● 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

And this is test output with development version with fix:

D:\src\jest-test  ([email protected])
λ node D:\src\jest\packages\jest-cli\bin\jest.js
 PASS  __tests__/dummy.js
  Dummy test
    √ should pass (67 ms)

  console.info
    LANG: undefined

      at Object.info (__tests__/dummy.js:3:15)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        2.914 s, estimated 4 s
Ran all test suites.

- Call `camelcase` function providing `en-US` as locale while validating CLI options.
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SimenB SimenB merged commit b16082c into jestjs:master May 16, 2021
@github-actions
Copy link

This pull request 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 github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jest v26 is failing when run without cli options
3 participants