From bc76aebb719993d362ad87dd91a110d2059d7bb1 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Mon, 2 Dec 2024 10:33:28 -0800 Subject: [PATCH] Fix tests. --- crates/cli/tests/bin_test.rs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/crates/cli/tests/bin_test.rs b/crates/cli/tests/bin_test.rs index 08f2f7862..df7095d67 100644 --- a/crates/cli/tests/bin_test.rs +++ b/crates/cli/tests/bin_test.rs @@ -11,11 +11,11 @@ mod bin { let sandbox = create_empty_proto_sandbox(); let assert = sandbox.run_bin(|cmd| { - cmd.arg("bin").arg("npm").arg("9.0.0"); + cmd.arg("bin").arg("node").arg("19.0.0"); }); assert.inner.stderr(predicate::str::contains( - "Unable to find an executable for npm", + "Unable to find an executable for Node.js", )); } @@ -25,22 +25,22 @@ mod bin { sandbox .run_bin(|cmd| { - cmd.arg("install").arg("npm").arg("9.0.0"); + cmd.arg("install").arg("node").arg("19.0.0"); }) .success(); let assert = sandbox.run_bin(|cmd| { - cmd.arg("bin").arg("npm").arg("9.0.0"); + cmd.arg("bin").arg("node").arg("19.0.0"); }); if cfg!(windows) { - assert.inner.stdout(predicate::str::contains( - "tools\\npm\\9.0.0\\bin/npm-cli.js", - )); + assert + .inner + .stdout(predicate::str::contains("tools\\node\\19.0.0\\node.exe")); } else { assert .inner - .stdout(predicate::str::contains("tools/npm/9.0.0/bin/npm-cli.js")); + .stdout(predicate::str::contains("tools/node/19.0.0/bin/node")); } } @@ -50,20 +50,18 @@ mod bin { sandbox .run_bin(|cmd| { - cmd.arg("install").arg("npm").arg("9.0.0"); + cmd.arg("install").arg("node").arg("19.0.0"); }) .success(); let assert = sandbox.run_bin(|cmd| { - cmd.arg("bin").arg("npm").arg("9.0.0").arg("--bin"); + cmd.arg("bin").arg("node").arg("19.0.0").arg("--bin"); }); if cfg!(windows) { - assert - .inner - .stdout(predicate::str::contains("bin/npm-cli.js")); + assert.inner.stdout(predicate::str::contains("node.exe")); } else { - assert.inner.stdout(predicate::str::contains("bin/npm")); + assert.inner.stdout(predicate::str::contains("bin/node")); } } @@ -73,20 +71,20 @@ mod bin { sandbox .run_bin(|cmd| { - cmd.arg("install").arg("npm").arg("9.0.0"); + cmd.arg("install").arg("node").arg("19.0.0"); }) .success(); let assert = sandbox.run_bin(|cmd| { - cmd.arg("bin").arg("npm").arg("9.0.0").arg("--shim"); + cmd.arg("bin").arg("node").arg("19.0.0").arg("--shim"); }); if cfg!(windows) { assert .inner - .stdout(predicate::str::contains("shims\\npm.exe")); + .stdout(predicate::str::contains("shims\\node.exe")); } else { - assert.inner.stdout(predicate::str::contains("shims/npm")); + assert.inner.stdout(predicate::str::contains("shims/node")); } } }