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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
russokj authored and MylesBorins committed Feb 1, 2017
1 parent 9f13b5f commit 11115c0
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 must be a positive number$/);

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

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

e.emit('maxListeners');

0 comments on commit 11115c0

Please sign in to comment.