Skip to content

Commit

Permalink
Nodeconf is awesome first change
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Ashfield authored and Trott committed Nov 8, 2017
1 parent d82bedc commit 81cfdc6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/addons-napi/test_general/testNapiRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ 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');
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);
const args = [41.92, 0.08];
const testCase = '(' + args.join(' + ') + ');';
const expected = 43;
const actual = addon.testNapiRun(testCase);

assert.strictEqual(actual, expected, `testNapiRun${testCase} gets ${actual} not expected ${expected}`);
assert.throws(() => addon.testNapiRun({abc: 'def'}), /string was expected/);

0 comments on commit 81cfdc6

Please sign in to comment.