'use strict';
require('../common');
const {
buildSEA,
skipIfBuildSEAIsNotSupported,
} = require('../common/sea');
skipIfBuildSEAIsNotSupported();
// This tests the creation of a single executable application with an ESM
// entry point using the "mainFormat": "module" configuration.
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const { spawnSyncAndExitWithoutError } = require('../common/child_process');
tmpdir.refresh();
const outputFile = buildSEA(fixtures.path('sea', 'esm'));
spawnSyncAndExitWithoutError(
outputFile,
{
env: {
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
},
{
stdout: /ESM SEA executed successfully/,
});