11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci// `addon` is referenced through the eval expression in testFile 71cb0ef41Sopenharmony_ciconst addon = require(`./build/${common.buildType}/test_general`); 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ciconst testCase = '(41.92 + 0.08);'; 101cb0ef41Sopenharmony_ciconst expected = 42; 111cb0ef41Sopenharmony_ciconst actual = addon.testNapiRun(testCase); 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ciassert.strictEqual(actual, expected); 141cb0ef41Sopenharmony_ciassert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/); 15