Skip to content

Commit

Permalink
test: Fix test failure in non-English locales (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar303 committed Mar 9, 2017
1 parent 333062c commit 8c53c29
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/unit/test.program.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ describe('program.Program', () => {
return execProgram(new Program(['--nope']))
.then(makeSureItFails())
.catch((error) => {
// It's a bit weird that yargs calls this an argument rather
// than an option but, hey, it's an error.
assert.match(error.message, /Unknown argument: nope/);
// Make sure that the option name is in the error message.
// Be careful not to rely on any text from yargs since it's localized.
assert.match(error.message, /nope/);
});
});

Expand All @@ -233,8 +233,9 @@ describe('program.Program', () => {
return execProgram(program)
.then(makeSureItFails())
.catch((error) => {
// Again, yargs calls this an argument not an option for some reason.
assert.match(error.message, /Unknown argument: nope/);
// Make sure that the option name is in the error message.
// Be careful not to rely on any text from yargs since it's localized.
assert.match(error.message, /nope/);
});
});

Expand Down

0 comments on commit 8c53c29

Please sign in to comment.