The Node.js tests check uses its stand-in program on Windows too (#783)

The Node.js tests check's test clears the toolchain's Windows program name, so on Windows it runs its stand-in instead of the real npm. Test only.
This commit is contained in:
BFlat
2026-11-04 10:57:42 +07:00
committed by GitHub
parent 0356c4bc88
commit 10fc638e24
+2 -1
View File
@@ -308,7 +308,8 @@ mod tests {
let (d, stop) = (tempfile::tempdir().unwrap(), CancelToken::default());
std::fs::write(d.path().join("package.json"), "").unwrap();
let table = stacks::toolchain_in(d.path()).expect("the table has Node.js");
let node = stacks::Toolchain { test: vec!["no-such-program-here".into()], ..table.clone() };
// Without the Windows name (npm.cmd), which would start the real npm instead of the stand-in.
let node = stacks::Toolchain { test: vec!["no-such-program-here".into()], windows_program: None, ..table.clone() };
for json in [r#"{"name":"x"}"#, r#"{"scripts":{"test":"echo \"Error: no test specified\" && exit 1"}}"#] {
std::fs::write(d.path().join("package.json"), json).unwrap();
let (passed, note) = own_tests_check(d.path(), Some(&node), &stop);