Skip to content

Craft Anything: understand how any software works, and craft your own.

Rust

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

BFlat10fc638e249f
diff --git a/crates/ai/src/rebuild/check.rs b/crates/ai/src/rebuild/check.rs
index c7537a72..6046a1b4 100644
--- a/crates/ai/src/rebuild/check.rs
+++ b/crates/ai/src/rebuild/check.rs
@@ -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);