summaryrefslogtreecommitdiff
path: root/test/addons-napi
diff options
context:
space:
mode:
authorAttila Gonda <pcdevil7@gmail.com>2017-11-06 15:12:19 +0000
committerGibson Fahnestock <gibfahn@gmail.com>2017-12-13 16:54:28 +0000
commitd2b32ce0744ddd20ea72bfcd1d1bdb218cf10622 (patch)
treef1c0f2a0e2fad9896b00c204642615f08dbed53e /test/addons-napi
parent55bf57dc9a54a9d290361dce73bf03b693e6b234 (diff)
downloadnode-new-d2b32ce0744ddd20ea72bfcd1d1bdb218cf10622.tar.gz
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>
Diffstat (limited to 'test/addons-napi')
-rw-r--r--test/addons-napi/test_typedarray/test.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/addons-napi/test_typedarray/test.js b/test/addons-napi/test_typedarray/test.js
index 25f701f2d3..27ef054fe4 100644
--- a/test/addons-napi/test_typedarray/test.js
+++ b/test/addons-napi/test_typedarray/test.js
@@ -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);
});