Skip to content

Commit 18fdcad

Browse files
committed
Executable scripts need the mjs extension
1 parent 0be1768 commit 18fdcad

File tree

1 file changed

+5
-1
lines changed
  • crates/cli/src/bin/wasm-bindgen-test-runner

1 file changed

+5
-1
lines changed

crates/cli/src/bin/wasm-bindgen-test-runner/node.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ pub fn execute(
9898
",
9999
);
100100

101-
let js_path = tmpdir.join("run.js");
101+
let js_path = if module_format {
102+
tmpdir.join("run.mjs")
103+
} else {
104+
tmpdir.join("run.cjs")
105+
};
102106
fs::write(&js_path, js_to_execute).context("failed to write JS file")?;
103107

104108
// Augment `NODE_PATH` so things like `require("tests/my-custom.js")` work

0 commit comments

Comments
 (0)