node/test/sea/test-single-executable-application-empty.js
Joyee Cheung 6eaf1b85ed
test: migrate to --build-sea in existing SEA tests
Only leave a smoking test for the postject-based workflow
in test-single-executable-application.js

PR-URL: https://github.com/nodejs/node/pull/61167
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-01-22 23:32:51 +01:00

45 lines
935 B
JavaScript

'use strict';
const common = require('../common');
const {
buildSEA,
skipIfBuildSEAIsNotSupported,
} = require('../common/sea');
skipIfBuildSEAIsNotSupported();
// This tests the creation of a single executable application with an empty
// script.
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const { spawnSyncAndExitWithoutError } = require('../common/child_process');
tmpdir.refresh();
let outputFile;
try {
outputFile = buildSEA(fixtures.path('sea', 'empty'), {
verifyWorkflow: true,
});
} catch (e) {
if (/Cannot copy/.test(e.message)) {
common.skip(e.message);
} else if (common.isWindows) {
if (/Cannot sign/.test(e.message) || /Cannot find signtool/.test(e.message)) {
common.skip(e.message);
}
}
throw e;
}
spawnSyncAndExitWithoutError(
outputFile,
{
env: {
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
});