Skip to content

Commit 25ff7bf

Browse files
Paul Ashfieldgibfahn
Paul Ashfield
authored andcommitted
test: improve error emssage reporting in testNapiRun.js
PR-URL: #16821 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 81970f8 commit 25ff7bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/addons-napi/test_general/testNapiRun.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const assert = require('assert');
77
// eslint-disable-next-line no-unused-vars
88
const addon = require(`./build/${common.buildType}/test_general`);
99

10-
assert.strictEqual(addon.testNapiRun('(41.92 + 0.08);'), 42,
11-
'napi_run_script() works correctly');
10+
const testCase = '(41.92 + 0.08);';
11+
const expected = 42;
12+
const actual = addon.testNapiRun(testCase);
13+
14+
assert.strictEqual(actual, expected);
1215
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);

0 commit comments

Comments
 (0)