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: nodejs#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 cjihrig committed Nov 7, 2017
1 parent 6831e42 commit d054e94
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 d054e94

Please sign in to comment.