Skip to content
Merged
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
15 changes: 6 additions & 9 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,16 @@ assert.throws(() => {
{
// Bad args to AssertionError constructor should throw TypeError.
const args = [1, true, false, '', null, Infinity, Symbol('test'), undefined];
args.forEach((input) => {
for (const input of args) {
assert.throws(
() => new assert.AssertionError(input),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: 'The "options" argument must be of type object.' +
common.invalidArgTypeHelper(input)
common.invalidArgTypeHelper(input)
Comment thread
tniessen marked this conversation as resolved.
Outdated
});
});
}
}

assert.throws(
Expand Down Expand Up @@ -965,11 +965,8 @@ assert.throws(
}
);

[
1,
false,
Symbol(),
].forEach((input) => {
const inputs = [1, false, Symbol()];
for (const input of inputs) {
assert.throws(
() => assert.throws(() => {}, input),
{
Expand All @@ -979,7 +976,7 @@ assert.throws(
common.invalidArgTypeHelper(input)
}
);
});
}

{

Expand Down