From d2b32ce0744ddd20ea72bfcd1d1bdb218cf10622 Mon Sep 17 00:00:00 2001 From: Attila Gonda Date: Mon, 6 Nov 2017 15:12:19 +0000 Subject: [PATCH] test: add detailed message for assertion failure PR-URL: https://github.com/nodejs/node/pull/16812 Reviewed-By: Rich Trott Reviewed-By: Joyee Cheung Reviewed-By: Gireesh Punathil --- test/addons-napi/test_typedarray/test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/addons-napi/test_typedarray/test.js b/test/addons-napi/test_typedarray/test.js index 25f701f2d30c70..27ef054fe4635e 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); });