mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
Signed-off-by: Ali Hassan <ali-hassan27@outlook.com> PR-URL: https://github.com/nodejs/node/pull/62678 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
35 lines
707 B
JavaScript
35 lines
707 B
JavaScript
'use strict';
|
|
|
|
// This tests that import() works in a CJS single executable application
|
|
// when useCodeCache is true.
|
|
|
|
require('../common');
|
|
|
|
const {
|
|
buildSEA,
|
|
skipIfBuildSEAIsNotSupported,
|
|
} = require('../common/sea');
|
|
|
|
skipIfBuildSEAIsNotSupported();
|
|
|
|
const tmpdir = require('../common/tmpdir');
|
|
const fixtures = require('../common/fixtures');
|
|
const { spawnSyncAndAssert } = require('../common/child_process');
|
|
|
|
tmpdir.refresh();
|
|
|
|
const outputFile = buildSEA(fixtures.path('sea', 'use-code-cache-dynamic-import'));
|
|
|
|
spawnSyncAndAssert(
|
|
outputFile,
|
|
[],
|
|
{
|
|
env: {
|
|
NODE_DEBUG_NATIVE: 'SEA',
|
|
...process.env,
|
|
},
|
|
},
|
|
{
|
|
stdout: 'dynamic import with code cache works\n',
|
|
});
|