node/test/es-module/test-esm-wasm-source-phase-not-defined-static.mjs
Antoine du Hamel d4034dfb62
test: forbid use of named imports for fixtures
PR-URL: https://github.com/nodejs/node/pull/61228
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-02-22 23:16:09 +01:00

19 lines
644 B
JavaScript

// Test that error is thrown for static source phase imports not defined
import '../common/index.mjs';
import assert from 'node:assert';
import { spawnSyncAndAssert } from '../common/child_process.js';
import * as fixtures from '../common/fixtures.mjs';
const fileUrl = fixtures.fileURL('es-modules/wasm-source-phase.js').href;
spawnSyncAndAssert(
process.execPath,
['--no-warnings', fixtures.path('es-modules/test-wasm-source-phase-not-defined-static.mjs')],
{
status: 1,
stderr(output) {
assert.match(output, /Source phase import object is not defined for module/);
assert(output.includes(fileUrl));
},
}
);