Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors: extract type detection & use in ERR_INVALID_RETURN_VALUE #43558

24 changes: 12 additions & 12 deletions test/errors/test-error-value-type-detection.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,51 +63,51 @@ strictEqual(
);

strictEqual(
determineSpecificType(new Array(0)),
determineSpecificType(new Array()),
'an instance of Array',
);
strictEqual(
determineSpecificType(new BigInt64Array(0)),
determineSpecificType(new BigInt64Array()),
'an instance of BigInt64Array',
);
strictEqual(
determineSpecificType(new BigUint64Array(0)),
determineSpecificType(new BigUint64Array()),
'an instance of BigUint64Array',
);
strictEqual(
determineSpecificType(new Int8Array(0)),
determineSpecificType(new Int8Array()),
'an instance of Int8Array',
);
strictEqual(
determineSpecificType(new Int16Array(0)),
determineSpecificType(new Int16Array()),
'an instance of Int16Array',
);
strictEqual(
determineSpecificType(new Int32Array(0)),
determineSpecificType(new Int32Array()),
'an instance of Int32Array',
);
strictEqual(
determineSpecificType(new Float32Array(0)),
determineSpecificType(new Float32Array()),
'an instance of Float32Array',
);
strictEqual(
determineSpecificType(new Float64Array(0)),
determineSpecificType(new Float64Array()),
'an instance of Float64Array',
);
strictEqual(
determineSpecificType(new Uint8Array(0)),
determineSpecificType(new Uint8Array()),
'an instance of Uint8Array',
);
strictEqual(
determineSpecificType(new Uint8ClampedArray(0)),
determineSpecificType(new Uint8ClampedArray()),
'an instance of Uint8ClampedArray',
);
strictEqual(
determineSpecificType(new Uint16Array(0)),
determineSpecificType(new Uint16Array()),
'an instance of Uint16Array',
);
strictEqual(
determineSpecificType(new Uint32Array(0)),
determineSpecificType(new Uint32Array()),
'an instance of Uint32Array',
);

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const invalidThenableFunc = () => {
promises.push(assert.rejects(promise, {
name: 'TypeError',
code: 'ERR_INVALID_RETURN_VALUE',
// FIXME: This should use substring matching for key words, like /Promise/ and /undefined/
// FIXME(@JakobJingleheimer): This should match on key words, like /Promise/ and /undefined/
JakobJingleheimer marked this conversation as resolved.
Show resolved Hide resolved
message: 'Expected instance of Promise to be returned ' +
'from the "promiseFn" function but got undefined.'
}));
Expand Down