node/test/js-native-api/test_general/testNapiRun.js
Rich Trott b0a334be8d test: remove unnecessary eslint-disable comments
PR-URL: https://github.com/nodejs/node/pull/25119
Refs: https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-21 10:38:43 -08:00

15 lines
442 B
JavaScript

'use strict';
const common = require('../../common');
const assert = require('assert');
// `addon` is referenced through the eval expression in testFile
const addon = require(`./build/${common.buildType}/test_general`);
const testCase = '(41.92 + 0.08);';
const expected = 42;
const actual = addon.testNapiRun(testCase);
assert.strictEqual(actual, expected);
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);