mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: add second argument to assert.throws()
The assert.throws() calls in test-event-emitter-max-listeners.js should include a constructor or RegExp as a second argument. PR-URL: https://github.com/nodejs/node/pull/9987 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
610ec557a6
commit
0ab2cfc64e
1 file changed
+6
-6
@@ -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() {}));
|
||||
|
||||
@@ -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');
|
||||
Reference in new issue
Block a user