test(javascript): align semantic fixtures with runtime context

This commit is contained in:
morluto committed 2026-10-24 08:22:13 +08:00
1 parent c3ad8fc024
commit 59553c76be
4 files changed
+31 -12

No files matched your search

@@ -138,9 +138,12 @@ it.each([
] as const)(
"distinguishes wrapper-local child identities and uncertain bindings: %s (%s)",
(path, declarations, expected) => {
const loader = path.endsWith(".mjs")
? 'import {spawn,exec} from "node:child_process";'
: 'const {spawn,exec}=require("node:child_process");';
const file = parseJavaScriptSource(
`
const {spawn,exec}=require("node:child_process");
${loader}
${declarations}
spawn("argv",argv,{stdio:"inherit"}); exec("callback",done);
`,