From 2476ab961926336b17edbad123227e9371f18452 Mon Sep 17 00:00:00 2001 From: Paul Ashfield Date: Mon, 6 Nov 2017 15:32:35 +0000 Subject: [PATCH] test: improve error emssage reporting in testNapiRun.js Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16821 Reviewed-By: Rich Trott Reviewed-By: Gireesh Punathil --- test/addons-napi/test_general/testNapiRun.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/addons-napi/test_general/testNapiRun.js b/test/addons-napi/test_general/testNapiRun.js index d7534ecf9c3912..af9f89fa29d53d 100644 --- a/test/addons-napi/test_general/testNapiRun.js +++ b/test/addons-napi/test_general/testNapiRun.js @@ -7,6 +7,9 @@ const assert = require('assert'); // eslint-disable-next-line no-unused-vars const addon = require(`./build/${common.buildType}/test_general`); -assert.strictEqual(addon.testNapiRun('(41.92 + 0.08);'), 42, - 'napi_run_script() works correctly'); +const testCase = '(41.92 + 0.08);'; +const expected = 42; +const actual = addon.testNapiRun(testCase); + +assert.strictEqual(actual, expected); assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);