From e3d42dc1d9361f738af3f18a0ac05f73b9507ee1 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sun, 7 Apr 2019 11:47:31 +0200 Subject: [PATCH] test: accept differently formatted output The default for Node.js's `util.inspect` `compact` option might soon change to `3` which slightly changes the default output for objects. This change accepts both formats so that the test passes in all Node.js versions. Refs: https://github.com/nodejs/node/pull/27109 --- test/yargs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/yargs.js b/test/yargs.js index 4f5de3449..40606b7db 100644 --- a/test/yargs.js +++ b/test/yargs.js @@ -522,7 +522,7 @@ describe('yargs dsl tests', () => { builder (yargs) { return yargs }, handler (argv) {} }) - }).to.throw(/No command name given for module: { desc: 'A command with no name',\n {2}builder: \[Function(: builder)?],\n {2}handler: \[Function(: handler)?] }/) + }).to.throw(/No command name given for module: {(\n )? desc: 'A command with no name',\n {2}builder: \[Function(: builder)?],\n {2}handler: \[Function(: handler)?](\n| )}/) }) })