Skip to content

Commit e59c95a

Browse files
test(build): running with no rust should err
1 parent f45322c commit e59c95a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/all/build.rs

+17
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,20 @@ fn build_in_non_crate_directory_doesnt_panic() {
1919
let err_msg = result.unwrap_err().to_string();
2020
assert!(err_msg.contains("missing a `Cargo.toml`"));
2121
}
22+
23+
#[test]
24+
fn build_with_no_rust_is_err() {
25+
let fixture = utils::fixture::not_a_crate();
26+
let cli = Cli::from_iter_safe(vec![
27+
"wasm-pack",
28+
"build",
29+
&fixture.path.display().to_string(),
30+
]).unwrap();
31+
let logger = logger::new(&cli.cmd, cli.verbosity).unwrap();
32+
let result = command::run_wasm_pack(cli.cmd, &logger);
33+
assert!(
34+
result.is_err(),
35+
"running wasm-pack with no Rust should fail, but it should not panic"
36+
);
37+
let err_msg = result.unwrap_err().to_string();
38+
}

0 commit comments

Comments
 (0)