Skip to content

Commit df86333

Browse files
committed
test
1 parent d9cf38a commit df86333

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/unit/mocha.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ describe('Mocha', function() {
7878
});
7979
});
8080

81+
describe('.runnerOn()', function() {
82+
it('should add the given event to the runnerEvents array', function() {
83+
var mocha = new Mocha(opts);
84+
var fn = function() {};
85+
mocha.runnerOn('fake', fn);
86+
expect(mocha.runnerEvents, 'to have length', 1);
87+
expect(mocha.runnerEvents[0][0], 'to be', 'fake');
88+
expect(mocha.runnerEvents[0][1], 'to be', fn);
89+
var runner = mocha.run();
90+
expect(runner.listenerCount('fake'), 'to be', 1);
91+
});
92+
});
93+
8194
describe('.invert()', function() {
8295
it('should set the invert option to true', function() {
8396
var mocha = new Mocha(opts);

0 commit comments

Comments
 (0)