mirror of
https://github.com/storytold/craft-anything.git
synced 2026-11-05 20:47:45 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user