diff --git a/test/parallel/test-event-emitter-max-listeners.js b/test/parallel/test-event-emitter-max-listeners.js index 5dabbac6ae..85c3293298 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 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');