Skip to content

Commit fd8cc68

Browse files
committed
Fix some typos and add some internal documentation
1 parent 0e0ef61 commit fd8cc68

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

crates/volta-core/src/error/kind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ pub enum ErrorKind {
443443
name: String,
444444
},
445445

446-
/// Thrown when serializnig a bin config to JSON fails
446+
/// Thrown when serializing a bin config to JSON fails
447447
StringifyBinConfigError,
448448

449-
/// Thrown when serializnig a package config to JSON fails
449+
/// Thrown when serializing a package config to JSON fails
450450
StringifyPackageConfigError,
451451

452452
/// Thrown when serializing the platform to JSON fails

tests/acceptance/direct_uninstall.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! Tests for `npm uninstall`, `npm uninstall --global`, `yarn remove`, and
2+
//! `yarn global remove`, which we support as alternatives to `volta uninstall`
3+
//! and which should use its logic.
4+
15
use crate::support::sandbox::{sandbox, DistroMetadata, NodeFixture, Sandbox, Yarn1Fixture};
26
use hamcrest2::assert_that;
37
use hamcrest2::prelude::*;

tests/acceptance/volta_uninstall.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Tests for `volta uninstall`.
2+
13
use crate::support::sandbox::{sandbox, Sandbox};
24
use hamcrest2::assert_that;
35
use hamcrest2::prelude::*;
@@ -94,6 +96,36 @@ fn uninstall_package_basic() {
9496
assert!(!Sandbox::package_image_exists("cowsay"));
9597
}
9698

99+
#[test]
100+
fn uninstall_package_basic_with_version() {
101+
// basic uninstall - everything exists, and everything except the cached
102+
// inventory files should be deleted
103+
let s = sandbox()
104+
.package_config("cowsay", PKG_CONFIG_BASIC)
105+
.binary_config("cowsay", &bin_config("cowsay"))
106+
.binary_config("cowthink", &bin_config("cowthink"))
107+
.shim("cowsay")
108+
.shim("cowthink")
109+
.package_image("cowsay", "1.4.0", None)
110+
.env(VOLTA_LOGLEVEL, "info")
111+
.build();
112+
113+
assert_that!(
114+
s.volta("uninstall [email protected]"),
115+
execs().with_status(1).with_stderr_contains(
116+
"[..]error: uninstalling specific versions of tools is not supported yet."
117+
)
118+
);
119+
120+
// check that nothing is deleted.
121+
assert!(Sandbox::package_config_exists("cowsay"));
122+
assert!(Sandbox::bin_config_exists("cowsay"));
123+
assert!(Sandbox::bin_config_exists("cowthink"));
124+
assert!(Sandbox::shim_exists("cowsay"));
125+
assert!(Sandbox::shim_exists("cowthink"));
126+
assert!(Sandbox::package_image_exists("cowsay"));
127+
}
128+
97129
#[test]
98130
fn uninstall_package_no_bins() {
99131
// the package doesn't contain any executables, it should uninstall without error

0 commit comments

Comments
 (0)