From ba36d8abe81805d3f4fe1248197eca2a02aa23bf Mon Sep 17 00:00:00 2001 From: huangjj27 Date: Thu, 11 Oct 2018 22:12:56 +0800 Subject: [PATCH] test(command/build): add test for fix-390 --- tests/all/build.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/all/build.rs b/tests/all/build.rs index 69a9bab97..6243ff977 100644 --- a/tests/all/build.rs +++ b/tests/all/build.rs @@ -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", + ); +} \ No newline at end of file