Skip to content

Commit

Permalink
test: fix unstable help test by locale on localhost (#390)
Browse files Browse the repository at this point in the history
The `yargs` package depends on the `os-locale` package to guess the locale.
The `os-locale` package prioritizes `LC_ALL` over `LANG`.

See below:
- https://github.com/yargs/yargs/blob/51876e69c71e9861fb09847530eeaec9be534f5f/yargs.js#L1184
- https://github.com/sindresorhus/os-locale/blob/22e9f2e66e1493ffda58c9ed8f936f554bccb76f/index.js#L10
  • Loading branch information
ybiquitous committed May 6, 2019
1 parent 21ba6a9 commit 0716e88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/helpers/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const tested = path.join(process.cwd(), "bin", "cli.js");

module.exports = function exec(...args) {
const options = {
env: { ...process.env, LANG: "C" },
env: { ...process.env, LC_ALL: "C" },
};
const lastArg = args[args.length - 1];
if (lastArg && typeof lastArg === "object") {
Expand Down

0 comments on commit 0716e88

Please sign in to comment.