Skip to content

Commit

Permalink
test: add second argument to assert.throws()
Browse files Browse the repository at this point in the history
The assert.throws() calls in test-event-emitter-max-listeners.js
should include a constructor or RegExp as a second argument.

PR-URL: #9987
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
russokj authored and targos committed Dec 26, 2016
1 parent 610ec55 commit 0ab2cfc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-event-emitter-max-listeners.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
const common = require('../common');
var assert = require('assert');
var events = require('events');
var e = new events.EventEmitter();
const assert = require('assert');
const events = require('events');
const e = new events.EventEmitter();

e.on('maxListeners', common.mustCall(function() {}));

Expand All @@ -11,14 +11,14 @@ e.setMaxListeners(42);

assert.throws(function() {
e.setMaxListeners(NaN);
});
}, /^TypeError: "n" argument must be a positive number$/);

assert.throws(function() {
e.setMaxListeners(-1);
});
}, /^TypeError: "n" argument must be a positive number$/);

assert.throws(function() {
e.setMaxListeners('and even this');
});
}, /^TypeError: "n" argument must be a positive number$/);

e.emit('maxListeners');

0 comments on commit 0ab2cfc

Please sign in to comment.