Skip to content

Commit 1729af2

Browse files
jackhortonBridgeAR
authored andcommitted
test: convert new tests to use error types
PR-URL: #18581 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 93bbe4e commit 1729af2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

test/addons-napi/test_typedarray/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ arrayTypes.forEach((currentType) => {
6060
const template = Reflect.construct(currentType, buffer);
6161
assert.throws(() => {
6262
test_typedarray.CreateTypedArray(template, buffer, 0, 136);
63-
}, /Invalid typed array length/);
63+
}, RangeError);
6464
});
6565

6666
const nonByteArrayTypes = [ Int16Array, Uint16Array, Int32Array, Uint32Array,
@@ -71,5 +71,5 @@ nonByteArrayTypes.forEach((currentType) => {
7171
test_typedarray.CreateTypedArray(template, buffer,
7272
currentType.BYTES_PER_ELEMENT + 1, 1);
7373
console.log(`start of offset ${currentType}`);
74-
}, /start offset of/);
74+
}, RangeError);
7575
});

test/parallel/test-console-assign-undefined.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ assert.strictEqual(global.console, 42);
1717
common.expectsError(
1818
() => console.log('foo'),
1919
{
20-
type: TypeError,
21-
message: 'console.log is not a function'
20+
type: TypeError
2221
}
2322
);
2423

0 commit comments

Comments
 (0)