node/test/es-module/test-esm-wasm-source-phase-not-defined-static.mjs
Antoine du Hamel 987740399d
tools: enforce trailing commas in test/es-module
PR-URL: https://github.com/nodejs/node/pull/60891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-12-03 14:18:40 +01:00

20 lines
643 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.js';
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));
},
}
);