diff --git a/test/unit/mocha.spec.js b/test/unit/mocha.spec.js index 5cb6319d4d..aa884f0cbd 100644 --- a/test/unit/mocha.spec.js +++ b/test/unit/mocha.spec.js @@ -78,6 +78,19 @@ describe('Mocha', function() { }); }); + describe('.runnerOn()', function() { + it('should add the given event to the runnerEvents array', function() { + var mocha = new Mocha(opts); + var fn = function() {}; + mocha.runnerOn('fake', fn); + expect(mocha.runnerEvents, 'to have length', 1); + expect(mocha.runnerEvents[0][0], 'to be', 'fake'); + expect(mocha.runnerEvents[0][1], 'to be', fn); + var runner = mocha.run(); + expect(runner.listenerCount('fake'), 'to be', 1); + }); + }); + describe('.invert()', function() { it('should set the invert option to true', function() { var mocha = new Mocha(opts);