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‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ arrayTypes.forEach((currentType) =>{
6060
consttemplate=Reflect.construct(currentType,buffer);
6161
assert.throws(()=>{
6262
test_typedarray.CreateTypedArray(template,buffer,0,136);
63-
},/Invalidtypedarraylength/);
63+
},RangeError);
6464
});
6565

6666
constnonByteArrayTypes=[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-
},/startoffsetof/);
74+
},RangeError);
7575
});

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

Lines changed: 1 addition & 2 deletions
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)