mirror of https://github.com/nodejs/node.git
test: convert new tests to use error types
PR-URL: https://github.com/nodejs/node/pull/18581 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>pull/18629/merge
parent
93bbe4e3ee
commit
1729af2ce9
|
@ -60,7 +60,7 @@ arrayTypes.forEach((currentType) => {
|
|||
const template = Reflect.construct(currentType, buffer);
|
||||
assert.throws(() => {
|
||||
test_typedarray.CreateTypedArray(template, buffer, 0, 136);
|
||||
}, /Invalid typed array length/);
|
||||
}, RangeError);
|
||||
});
|
||||
|
||||
const nonByteArrayTypes = [ Int16Array, Uint16Array, Int32Array, Uint32Array,
|
||||
|
@ -71,5 +71,5 @@ nonByteArrayTypes.forEach((currentType) => {
|
|||
test_typedarray.CreateTypedArray(template, buffer,
|
||||
currentType.BYTES_PER_ELEMENT + 1, 1);
|
||||
console.log(`start of offset ${currentType}`);
|
||||
}, /start offset of/);
|
||||
}, RangeError);
|
||||
});
|
||||
|
|
|
@ -17,8 +17,7 @@ assert.strictEqual(global.console, 42);
|
|||
common.expectsError(
|
||||
() => console.log('foo'),
|
||||
{
|
||||
type: TypeError,
|
||||
message: 'console.log is not a function'
|
||||
type: TypeError
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue