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 Gabriel Schulhof committed Apr 16, 2018
1 parent ec2c784 commit 4c8826f
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 4c8826f

Please sign in to comment.