test: add detailed message for assertion failure

PR-URL: https://github.com/nodejs/node/pull/16812
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
Attila Gonda authored and cjihrig committed 2017-11-07 08:26:25 -05:00
1 parent 6831e42988
commit d054e94fdc
1 file changed
+3 -1
+3 -1
View File
@@ -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);
});