Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! remove validation for error message
  • Loading branch information
Lxxyx committed Nov 14, 2022
commit 7e7fc873f0e813abac6b96b84018cd36b8d9cff3
15 changes: 4 additions & 11 deletions test/parallel/test-event-emitter-max-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
const common = require('../common');
const assert = require('assert');
const events = require('events');
const { inspect } = require('util');

const throwInvalidType = [true, 'string'];
const throwOutOfRange = [-1, NaN];
Expand All @@ -42,8 +41,7 @@ const throwOutOfRange = [-1, NaN];
() => e.setMaxListeners(obj),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: `The "n" argument must be of type number. Received type ${typeof obj} (${inspect(obj)})`
name: 'TypeError'
}
);
}
Expand All @@ -53,9 +51,7 @@ const throwOutOfRange = [-1, NaN];
() => e.setMaxListeners(obj),
{
code: 'ERR_OUT_OF_RANGE',
name: 'RangeError',
message: 'The value of "n" is out of range. ' +
`It must be >= 0. Received ${inspect(obj)}`
name: 'RangeError'
}
);
}
Expand All @@ -70,8 +66,7 @@ const throwOutOfRange = [-1, NaN];
() => events.defaultMaxListeners = obj,
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: `The "defaultMaxListeners" argument must be of type number. Received type ${typeof obj} (${inspect(obj)})`
name: 'TypeError'
}
);
}
Expand All @@ -81,9 +76,7 @@ const throwOutOfRange = [-1, NaN];
() => events.defaultMaxListeners = obj,
{
code: 'ERR_OUT_OF_RANGE',
name: 'RangeError',
message: 'The value of "defaultMaxListeners" is out of range. ' +
`It must be >= 0. Received ${inspect(obj)}`
name: 'RangeError'
}
);
}
Expand Down