Skip to content

Commit

Permalink
Update tests with newer crate versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 committed Jun 28, 2021
1 parent 7a7abf9 commit 1f13f25
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions tests/all/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ fn dash_dash_web_target_has_error_on_old_bindgen() {
let output = String::from_utf8(cmd.get_output().stderr.clone()).unwrap();

assert!(
output.contains("0.2.39"),
"Output did not contain '0.2.39', output was {}",
output.contains("Please update your project to wasm-bindgen version >= 0.2.39"),
"Output did not contain 'Please update your project to wasm-bindgen version >= 0.2.39', output was {}",
output
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/all/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn can_download_prebuilt_wasm_bindgen() {
let dir = tempfile::TempDir::new().unwrap();
let cache = Cache::at(dir.path());
if let install::Status::Found(dl) =
install::download_prebuilt(&Tool::WasmBindgen, &cache, "0.2.37", true).unwrap()
install::download_prebuilt(&Tool::WasmBindgen, &cache, "0.2.74", true).unwrap()
{
assert!(dl.binary("wasm-bindgen").unwrap().is_file());
assert!(dl.binary("wasm-bindgen-test-runner").unwrap().is_file())
Expand All @@ -29,7 +29,7 @@ fn can_download_prebuilt_wasm_bindgen() {
))]
fn downloading_prebuilt_wasm_bindgen_handles_http_errors() {
let dir = tempfile::TempDir::new().unwrap();
let bad_version = "0.2.37-some-trailing-version-stuff-that-does-not-exist";
let bad_version = "0.2.74-some-trailing-version-stuff-that-does-not-exist";
let cache = Cache::at(dir.path());
let result = install::download_prebuilt(&Tool::WasmBindgen, &cache, bad_version, true);
assert!(result.is_err());
Expand Down
12 changes: 6 additions & 6 deletions tests/all/lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn it_gets_wasm_bindgen_version() {
fixture.cargo_check();
let data = CrateData::new(&fixture.path, None).unwrap();
let lock = Lockfile::new(&data).unwrap();
assert_eq!(lock.wasm_bindgen_version(), Some("0.2.37"),);
assert_eq!(lock.wasm_bindgen_version(), Some("0.2.74"),);
}

#[test]
Expand All @@ -17,7 +17,7 @@ fn it_gets_wasm_bindgen_test_version() {
fixture.cargo_check();
let data = CrateData::new(&fixture.path, None).unwrap();
let lock = Lockfile::new(&data).unwrap();
assert_eq!(lock.wasm_bindgen_test_version(), Some("0.2.37"),);
assert_eq!(lock.wasm_bindgen_test_version(), Some("0.3.24"),);
}

#[test]
Expand Down Expand Up @@ -46,7 +46,7 @@ fn it_gets_wasm_bindgen_version_in_crate_inside_workspace() {
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "=0.2.37"
wasm-bindgen = "=0.2.74"
"#,
)
.file(
Expand All @@ -62,7 +62,7 @@ fn it_gets_wasm_bindgen_version_in_crate_inside_workspace() {
fixture.cargo_check();
let data = CrateData::new(&fixture.path.join("blah"), None).unwrap();
let lock = Lockfile::new(&data).unwrap();
assert_eq!(lock.wasm_bindgen_version(), Some("0.2.37"),);
assert_eq!(lock.wasm_bindgen_version(), Some("0.2.74"),);
}

#[test]
Expand Down Expand Up @@ -91,7 +91,7 @@ fn it_gets_wasm_bindgen_version_from_dependencies() {
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "=0.2.37"
wasm-bindgen = "=0.2.74"
"#,
)
.file(
Expand Down Expand Up @@ -130,5 +130,5 @@ fn it_gets_wasm_bindgen_version_from_dependencies() {
fixture.cargo_check();
let data = CrateData::new(&fixture.path.join("parent"), None).unwrap();
let lock = Lockfile::new(&data).unwrap();
assert_eq!(lock.wasm_bindgen_version(), Some("0.2.37"),);
assert_eq!(lock.wasm_bindgen_version(), Some("0.2.74"),);
}
1 change: 0 additions & 1 deletion tests/all/log_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fn matches_info() -> impl Predicate<str> + PredicateReflection {
contains("[INFO]: Checking for the Wasm target...")
.and(contains("[INFO]: Compiling to Wasm..."))
.and(contains("[INFO]: License key is set in Cargo.toml but no LICENSE file(s) were found; Please add the LICENSE file(s) to your project directory"))
.and(contains("[INFO]: Installing wasm-bindgen..."))
.and(contains("[INFO]: Optimizing wasm binaries with `wasm-opt`..."))
.and(contains("[INFO]: :-) Done in "))
.and(contains("[INFO]: :-) Your wasm pkg is ready to publish at "))
Expand Down
14 changes: 7 additions & 7 deletions tests/all/utils/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ impl Fixture {
# bindgen downloaded is what we expect, and if `=` is
# removed then it will download whatever the newest version
# of wasm-bindgen is which may not be what's listed here.
wasm-bindgen = "=0.2.37"
wasm-bindgen = "=0.2.74"
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.3"
"#,
name
),
Expand Down Expand Up @@ -221,7 +221,7 @@ impl Fixture {

static INSTALL_WASM_BINDGEN: Once = Once::new();
let cache = self.cache();
let version = "0.2.37";
let version = "0.2.74";

let download = || {
if let Ok(download) =
Expand Down Expand Up @@ -417,7 +417,7 @@ pub fn no_cdylib() -> Fixture {
wasm-bindgen = "0.2"
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.3"
"#,
);
fixture
Expand Down Expand Up @@ -590,7 +590,7 @@ pub fn transitive_dependencies() -> Fixture {
project_b = { path = "../project_b" }
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.3"
"#,
);
fixture.file(
Expand Down Expand Up @@ -639,7 +639,7 @@ pub fn transitive_dependencies() -> Fixture {
project_b = { path = "../project_b" }
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.3"
"#,
);
fixture.file(
Expand Down Expand Up @@ -688,7 +688,7 @@ pub fn transitive_dependencies() -> Fixture {
wasm-bindgen = "0.2"
[dev-dependencies]
wasm-bindgen-test = "0.2"
wasm-bindgen-test = "0.3"
"#,
);
fixture.file(
Expand Down

0 comments on commit 1f13f25

Please sign in to comment.