Skip to content

Commit

Permalink
test: convert new tests to use error types
Browse files Browse the repository at this point in the history
PR-URL: nodejs#18581
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jackhorton authored and Gabriel Schulhof committed Apr 16, 2018
1 parent c7f4a4f commit 85728d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/addons-napi/test_typedarray/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
});

0 comments on commit 85728d1

Please sign in to comment.