2017-09-06 13:00:43 +03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
|
2018-12-10 13:27:32 +01:00
|
|
|
// `addon` is referenced through the eval expression in testFile
|
2018-01-23 21:49:25 +11:00
|
|
|
const addon = require(`./build/${common.buildType}/test_general`);
|
2017-09-06 13:00:43 +03:00
|
|
|
|
2017-11-06 15:32:35 +00:00
|
|
|
const testCase = '(41.92 + 0.08);';
|
|
|
|
const expected = 42;
|
|
|
|
const actual = addon.testNapiRun(testCase);
|
|
|
|
|
|
|
|
assert.strictEqual(actual, expected);
|
2017-09-06 13:00:43 +03:00
|
|
|
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);
|