Skip to content

Commit

Permalink
test: add detailed message for assertion failure
Browse files Browse the repository at this point in the history
Backport-PR-URL: #19447
PR-URL: #16812
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
pcdevil authored and MylesBorins committed Apr 16, 2018
1 parent d31792f commit c14207c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/addons-napi/test_typedarray/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ arrayTypes.forEach((currentType) => {
const theArray = test_typedarray.CreateTypedArray(template, buffer);

assert.ok(theArray instanceof currentType,
'Type of new array should match that of the template');
'Type of new array should match that of the template. ' +
`Expected type: ${currentType.name}, ` +
`actual type: ${template.constructor.name}`);
assert.notStrictEqual(theArray, template);
assert.strictEqual(theArray.buffer, buffer);
});

0 comments on commit c14207c

Please sign in to comment.