Skip to content

Commit

Permalink
test: add detailed message for assertion failure
Browse files Browse the repository at this point in the history
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 gibfahn committed Dec 13, 2017
1 parent 55bf57d commit d2b32ce
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 d2b32ce

Please sign in to comment.