Skip to content

Commit

Permalink
Updated test case based on feedback from @apapirovski @vsemozhetbyt a…
Browse files Browse the repository at this point in the history
…nd Gireesh - thanks all
  • Loading branch information
paulashfield authored and Trott committed Nov 8, 2017
1 parent 81cfdc6 commit a9d7c3d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/addons-napi/test_general/testNapiRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ const assert = require('assert');
// eslint-disable-next-line no-unused-vars
const addon = require(`./build/${common.buildType}/test_general`);

const args = [41.92, 0.08];
const testCase = '(' + args.join(' + ') + ');';
const expected = 43;
const testCase = '(41.92 + 0.08);';
const expected = 42;
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/);
assert.strictEqual(actual, expected);
assert.throws(() => addon.testNapiRun({abc: 'def'}), /string was expected/);

0 comments on commit a9d7c3d

Please sign in to comment.