mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: fix addons and node-api test assumptions
PR-URL: https://github.com/nodejs/node/pull/55441 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
3 files changed
+5
-13
No files matched your search
@@ -38,13 +38,8 @@ if (module !== require.main) {
|
||||
function testProcessExit(addonName) {
|
||||
// Make sure that process exit is clean when the instance data has
|
||||
// references to JS objects.
|
||||
const path = require
|
||||
.resolve(`./build/${common.buildType}/${addonName}`)
|
||||
// Replace any backslashes with double backslashes because they'll be re-
|
||||
// interpreted back to single backslashes in the command line argument
|
||||
// to the child process. Windows needs this.
|
||||
.replace(/\\/g, '\\\\');
|
||||
const child = spawnSync(process.execPath, ['-e', `require('${path}');`]);
|
||||
const path = require.resolve(`./build/${common.buildType}/${addonName}`);
|
||||
const child = spawnSync(process.execPath, ['-e', `require(${JSON.stringify(path)});`]);
|
||||
assert.strictEqual(child.signal, null);
|
||||
assert.strictEqual(child.status, 0);
|
||||
assert.strictEqual(child.stderr.toString(), 'addon_free');
|
||||
|
||||
Reference in new issue
Block a user