给缺宿主Node的npm目标单测加可见跳过提示

- npm_command_targets_node_plus_npm_cli_on_linux 跳过时 eprintln 输出原因(含 resolve_node_runtime 错误),配 --nocapture / --show-output 可与真实通过区分
This commit is contained in:
2026-10-07 14:17:49 +08:00
parent ef2a1bc749
commit d706b65643
@@ -2664,8 +2664,11 @@ mod tests {
let root = tempfile::tempdir().unwrap();
std::fs::create_dir_all(root.path().join("game")).unwrap();
// 这条用例走真实 resolve_node_runtime:没有可用宿主 Node 的最小容器里跳过,
// 保持 cargo test 可跑;其它失败仍然照常失败。
if crate::environment_check::resolve_node_runtime(root.path()).is_err() {
// 保持 cargo test 可跑;跳过时打印可见提示(配 --nocapture / --show-output 看得到)。
if let Err(error) = crate::environment_check::resolve_node_runtime(root.path()) {
eprintln!(
"skipping npm_command_targets_node_plus_npm_cli_on_linux: no host node runtime({error})"
);
return;
}
let spec = resolve_project_command_spec_at(