From 8c53c2958add5cb5f9a28c4d0324d66667b5eb37 Mon Sep 17 00:00:00 2001 From: Kumar McMillan Date: Thu, 9 Mar 2017 14:48:52 -0600 Subject: [PATCH] test: Fix test failure in non-English locales (#853) --- tests/unit/test.program.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/unit/test.program.js b/tests/unit/test.program.js index 6d432be607..2d868cc785 100644 --- a/tests/unit/test.program.js +++ b/tests/unit/test.program.js @@ -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/); }); }); @@ -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/); }); });