From 09f4fd2bd53de8c682bae931d8a57608c9230f88 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Thu, 24 Jan 2019 14:45:53 -0800 Subject: [PATCH] ensure invalid arguments are not ignored when using bin/mocha; closes #3687 Signed-off-by: Christopher Hiller --- test/integration/invalid-arguments.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/integration/invalid-arguments.spec.js diff --git a/test/integration/invalid-arguments.spec.js b/test/integration/invalid-arguments.spec.js new file mode 100644 index 0000000000..6c147bdb48 --- /dev/null +++ b/test/integration/invalid-arguments.spec.js @@ -0,0 +1,20 @@ +'use strict'; + +var invokeMocha = require('./helpers').invokeMocha; + +describe('invalid arguments', function() { + it('should exit with failure if arguments are invalid', function(done) { + invokeMocha( + ['--ui'], + function(err, result) { + if (err) { + return done(err); + } + expect(result, 'to have failed'); + expect(result.output, 'to match', /not enough arguments/i); + done(); + }, + {stdio: 'pipe'} + ); + }); +});