From 1f13f25d0fa2d9628d60273f1725bddeda04e1b9 Mon Sep 17 00:00:00 2001 From: Azriel Hoh Date: Mon, 28 Jun 2021 14:57:37 +1200 Subject: [PATCH] Update tests with newer crate versions. --- tests/all/build.rs | 4 ++-- tests/all/download.rs | 4 ++-- tests/all/lockfile.rs | 12 ++++++------ tests/all/log_level.rs | 1 - tests/all/utils/fixture.rs | 14 +++++++------- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tests/all/build.rs b/tests/all/build.rs index 79053704..0c59ba85 100644 --- a/tests/all/build.rs +++ b/tests/all/build.rs @@ -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 ); } diff --git a/tests/all/download.rs b/tests/all/download.rs index 3f5dec14..05d9f6d5 100644 --- a/tests/all/download.rs +++ b/tests/all/download.rs @@ -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()) @@ -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()); diff --git a/tests/all/lockfile.rs b/tests/all/lockfile.rs index 1a42ce88..f7a87843 100644 --- a/tests/all/lockfile.rs +++ b/tests/all/lockfile.rs @@ -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] @@ -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] @@ -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( @@ -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] @@ -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( @@ -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"),); } diff --git a/tests/all/log_level.rs b/tests/all/log_level.rs index d067742d..95a08cab 100644 --- a/tests/all/log_level.rs +++ b/tests/all/log_level.rs @@ -9,7 +9,6 @@ fn matches_info() -> impl Predicate + 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 ")) diff --git a/tests/all/utils/fixture.rs b/tests/all/utils/fixture.rs index 6c7c1c48..e51d904c 100644 --- a/tests/all/utils/fixture.rs +++ b/tests/all/utils/fixture.rs @@ -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 ), @@ -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) = @@ -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 @@ -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( @@ -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( @@ -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(