test: stabilize program tests locale#3701
Conversation
Rob--W
left a comment
There was a problem hiding this comment.
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
|
Updated this PR to address the review feedback from @Rob--W:
Local verification:
|
Rob--W
left a comment
There was a problem hiding this comment.
One more minor change and then it is good to merge. Thanks!
| const { spy } = sinon; | ||
|
|
||
| const stableLocale = 'en_US.UTF-8'; | ||
|
|
There was a problem hiding this comment.
This constant carries no special meaning beyond the place where it is used, and is used only once. Please inline the value where you use it.
|
Updated this PR to address the latest review feedback from @Rob--W:
Local verification:
|
Fixes #3676
Summary
program.Programunit tests that assert on yargs validation messages.Verification
npm cinpm run buildLANG=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'