From 1fddf5b6d6aa59c34822e60f7ec0d84b8793e16a Mon Sep 17 00:00:00 2001 From: Ken Russo Date: Thu, 1 Dec 2016 09:57:52 -0700 Subject: [PATCH] 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 Reviewed-By: James M Snell --- test/parallel/test-event-emitter-max-listeners.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-event-emitter-max-listeners.js b/test/parallel/test-event-emitter-max-listeners.js index 5dabbac6ae28c0..0ace154aa00a5c 100644 --- a/test/parallel/test-event-emitter-max-listeners.js +++ b/test/parallel/test-event-emitter-max-listeners.js @@ -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');