跳过缺少宿主Node时的npm目标单测
- npm_command_targets_node_plus_npm_cli_on_linux 先探测 resolve_node_runtime,最小容器无可用宿主 Node 时跳过,避免 cargo test 因缺 Node panic - 探测失败只跳过这一条真机用例,其它解析失败仍照常失败
This commit is contained in:
@@ -2650,6 +2650,11 @@ mod tests {
|
||||
fn npm_command_targets_node_plus_npm_cli_on_linux() {
|
||||
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() {
|
||||
return;
|
||||
}
|
||||
let spec = resolve_project_command_spec_at(
|
||||
root.path(),
|
||||
"npm",
|
||||
|
||||
Reference in New Issue
Block a user