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 2017-11-06 15:12:19 +00:00 committed by Gireesh Punathil
parent ac1e6bda89
commit 2336df1b50

View File

@ -49,7 +49,9 @@ arrayTypes.forEach((currentType) => {
const theArray = test_typedarray.CreateTypedArray(template, buffer); const theArray = test_typedarray.CreateTypedArray(template, buffer);
assert.ok(theArray instanceof currentType, 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.notStrictEqual(theArray, template);
assert.strictEqual(theArray.buffer, buffer); assert.strictEqual(theArray.buffer, buffer);
}); });