Skip to content

Commit

Permalink
test(command/build): add test for fix-390
Browse files Browse the repository at this point in the history
  • Loading branch information
huangjj27 committed Oct 11, 2018
1 parent 600649c commit ba36d8a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/all/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,24 @@ fn build_in_non_crate_directory_doesnt_panic() {
let err_msg = result.unwrap_err().to_string();
assert!(err_msg.contains("missing a `Cargo.toml`"));
}

#[cfg(target_os = "windows")]
#[test]
fn it_format_out_dir_on_windows() {
let fixture = utils::fixture::js_hello_world();
let cli = Cli::from_iter_safe(vec![
"wasm-pack",
"build",
&fixture.path.display().to_string(),
])
.unwrap();
let logger = logger::new(&cli.cmd, cli.verbosity).unwrap();
let result = command::run_wasm_pack(cli.cmd, &logger);
assert!(result.is_ok(), "js_hello_world example should pass");

let wasm_pack_log = utils::file::read_file(&fixture.path.join("wasm-pack.log")).unwrap();
assert!(
wasm_pack_log.contains(r"Your wasm pkg is ready to publish at \\?\C:\Users\"),
"directories in wasm-pack.log should be well formatted",
);
}

0 comments on commit ba36d8a

Please sign in to comment.