The Wayback Machine - https://web.archive.org/web/20250407172610/https://github.com/nodejs/node/commit/11115c0d85
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Commit 11115c0

Browse filesBrowse files
russokjMylesBorins
authored andcommitted
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: #9987 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 9f13b5f commit 11115c0
Copy full SHA for 11115c0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22
const common = require('../common');
3-
var assert = require('assert');
4-
var events = require('events');
5-
var e = new events.EventEmitter();
3+
const assert = require('assert');
4+
const events = require('events');
5+
const e = new events.EventEmitter();
66

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

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

1212
assert.throws(function() {
1313
e.setMaxListeners(NaN);
14-
});
14+
}, /^TypeError: n must be a positive number$/);
1515

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

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

2424
e.emit('maxListeners');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.