Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 30, 2023
1 parent d7593c9 commit a126631
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 36 deletions.
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ regex = { version = "1.10.2", default-features = false }
serde = "1.0.190"
serde_json = "1.0.108"
starbase_sandbox = "0.1.12"
tokio = "1.33.0"
tokio = { version = "1.33.0", features = ["full"] }
version_spec = "0.1.3"

[profile.release]
Expand Down
22 changes: 11 additions & 11 deletions crates/node-depman/tests/download_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod npm {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "9.0.0".into(),
version: VersionSpec::parse("9.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -48,7 +48,7 @@ mod npm {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "9.0.0".into(),
version: VersionSpec::parse("9.0.0").unwrap(),
..Default::default()
},
})
Expand Down Expand Up @@ -77,7 +77,7 @@ mod pnpm {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "8.0.0".into(),
version: VersionSpec::parse("8.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -105,7 +105,7 @@ mod pnpm {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "8.0.0".into(),
version: VersionSpec::parse("8.0.0").unwrap(),
..Default::default()
},
})
Expand Down Expand Up @@ -134,7 +134,7 @@ mod yarn {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "1.22.0".into(),
version: VersionSpec::parse("1.22.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -162,7 +162,7 @@ mod yarn {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "1.22.0".into(),
version: VersionSpec::parse("1.22.0").unwrap(),
..Default::default()
},
})
Expand Down Expand Up @@ -191,7 +191,7 @@ mod yarn_berry {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "3.6.1".into(),
version: VersionSpec::parse("3.6.1").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -220,7 +220,7 @@ mod yarn_berry {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "3.6.1".into(),
version: VersionSpec::parse("3.6.1").unwrap(),
..Default::default()
},
})
Expand Down Expand Up @@ -254,7 +254,7 @@ fn locates_bin_from_package_json_bin() {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
})
Expand Down Expand Up @@ -284,7 +284,7 @@ fn locates_bin_from_package_json_bin() {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "9.0.0".into(),
version: VersionSpec::parse("9.0.0").unwrap(),
..Default::default()
},
})
Expand Down Expand Up @@ -316,7 +316,7 @@ fn locates_bin_from_package_json_main() {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "8.0.0".into(),
version: VersionSpec::parse("8.0.0").unwrap(),
..Default::default()
},
})
Expand Down
2 changes: 1 addition & 1 deletion crates/node-depman/tests/metadata_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod npm {
ToolMetadataOutput {
name: "npm".into(),
type_of: PluginType::DependencyManager,
default_version: Some("bundled".into()),
default_version: Some(UnresolvedVersionSpec::Alias("bundled".into())),
plugin_version: Some(env!("CARGO_PKG_VERSION").into()),
..ToolMetadataOutput::default()
}
Expand Down
20 changes: 10 additions & 10 deletions crates/node-depman/tests/versions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mod npm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand All @@ -51,7 +51,7 @@ mod npm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand All @@ -67,7 +67,7 @@ mod npm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("latest".into()),
version: Some(UnresolvedVersionSpec::parse("latest").unwrap()),
}
);
}
Expand All @@ -83,7 +83,7 @@ mod npm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand Down Expand Up @@ -123,7 +123,7 @@ mod pnpm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand All @@ -139,7 +139,7 @@ mod pnpm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("latest".into()),
version: Some(UnresolvedVersionSpec::parse("latest").unwrap()),
}
);
}
Expand All @@ -155,7 +155,7 @@ mod pnpm {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand Down Expand Up @@ -196,7 +196,7 @@ mod yarn {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand All @@ -212,7 +212,7 @@ mod yarn {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("latest".into()),
version: Some(UnresolvedVersionSpec::parse("latest").unwrap()),
}
);
}
Expand All @@ -228,7 +228,7 @@ mod yarn {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some("1.2.3".into()),
version: Some(UnresolvedVersionSpec::parse("1.2.3").unwrap()),
}
);
}
Expand Down
24 changes: 12 additions & 12 deletions crates/node/tests/download_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn supports_linux_arm64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -53,7 +53,7 @@ fn supports_linux_arm() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -84,7 +84,7 @@ fn supports_linux_x64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -114,7 +114,7 @@ fn supports_linux_s390x() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -144,7 +144,7 @@ fn supports_linux_ppc64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -175,7 +175,7 @@ fn supports_macos_arm64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -206,7 +206,7 @@ fn supports_macos_x64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -236,7 +236,7 @@ fn supports_windows_arm64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -266,7 +266,7 @@ fn supports_windows_x64() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -296,7 +296,7 @@ fn supports_windows_x86() {
assert_eq!(
plugin.download_prebuilt(DownloadPrebuiltInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
..Default::default()
Expand Down Expand Up @@ -327,7 +327,7 @@ fn locates_unix_bin() {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
})
Expand All @@ -351,7 +351,7 @@ fn locates_windows_bin() {
plugin
.locate_bins(LocateBinsInput {
context: ToolContext {
version: "20.0.0".into(),
version: VersionSpec::parse("20.0.0").unwrap(),
..Default::default()
},
})
Expand Down
2 changes: 1 addition & 1 deletion crates/node/tests/versions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn parses_engines() {
file: "package.json".into(),
}),
ParseVersionFileOutput {
version: Some(">=16".into()),
version: Some(UnresolvedVersionSpec::parse(">=16").unwrap()),
}
);
}

0 comments on commit a126631

Please sign in to comment.