test: add spawnSyncAndAssert util

PR-URL: https://github.com/nodejs/node/pull/52132
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Antoine du Hamel 2024-03-20 20:44:14 +02:00 committed by GitHub
parent f69946b905
commit c714cda9a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 77 additions and 72 deletions

View file

@ -14,7 +14,7 @@ skipIfSingleExecutableIsNotSupported();
const tmpdir = require('../common/tmpdir');
const { writeFileSync, existsSync } = require('fs');
const {
spawnSyncAndExitWithoutError
spawnSyncAndAssert,
} = require('../common/child_process');
const { join } = require('path');
const assert = require('assert');
@ -45,7 +45,7 @@ const outputFile = join(tmpdir.path, process.platform === 'win32' ? 'sea.exe' :
}
`);
spawnSyncAndExitWithoutError(
spawnSyncAndAssert(
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{
@ -64,7 +64,7 @@ const outputFile = join(tmpdir.path, process.platform === 'win32' ? 'sea.exe' :
generateSEA(outputFile, process.execPath, seaPrepBlob);
spawnSyncAndExitWithoutError(
spawnSyncAndAssert(
outputFile,
{
env: {