Skip to content

test: stabilize program tests locale#3701

Open
cyphercodes wants to merge 1 commit intomozilla:masterfrom
cyphercodes:fix-locale-program-tests
Open

test: stabilize program tests locale#3701
cyphercodes wants to merge 1 commit intomozilla:masterfrom
cyphercodes:fix-locale-program-tests

Conversation

@cyphercodes
Copy link
Copy Markdown

Fixes #3676

Summary

  • Force a stable English locale for program.Program unit tests that assert on yargs validation messages.
  • Restore the caller's locale environment afterward so other tests and product behavior are unchanged.

Verification

  • npm ci
  • npm run build
  • LANG=de_DE.UTF-8 ./node_modules/.bin/mocha tests/unit/test.setup.js tests/unit/test.program.js --grep 'reports unknown commands|throws an error about unknown commands'

Copy link
Copy Markdown
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

Could we keep it simple and only set the LC_ALL environment variable? If set all others are not used. Yargs's relevant source is https://github.com/yargs/yargs/blob/437f3a4e0f4166e1f1a3ce023b0331159582746d/lib/yargs-factory.ts#L1593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm test with locale de_DE.UTF-8 fails 2 tests

2 participants