• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../../common');
4const assert = require('assert');
5
6// `addon` is referenced through the eval expression in testFile
7const addon = require(`./build/${common.buildType}/test_general`);
8
9const testCase = '(41.92 + 0.08);';
10const expected = 42;
11const actual = addon.testNapiRun(testCase);
12
13assert.strictEqual(actual, expected);
14assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);
15