From 6c49a29cb3b436fb47d905a9af62f82ca9d5b0ea 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. --- 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');