|
|
|
@ -1,8 +1,6 @@ |
|
|
|
|
extern crate dir_diff; |
|
|
|
|
extern crate wasm_pack; |
|
|
|
|
|
|
|
|
|
use std::fs; |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn it_gets_the_crate_name_default_path() { |
|
|
|
|
assert!(wasm_pack::get_crate_name(".").is_ok()); |
|
|
|
@ -27,5 +25,8 @@ fn it_creates_a_package_json_default_path() { |
|
|
|
|
#[test] |
|
|
|
|
fn it_creates_a_package_json_provided_path() { |
|
|
|
|
assert!(wasm_pack::write_package_json("./examples/js-hello-world").is_ok()); |
|
|
|
|
assert!(fs::metadata("./examples/js-hello-world/pkg/package.json").is_ok()); |
|
|
|
|
assert!(!dir_diff::is_different( |
|
|
|
|
"./examples/js-hello-world/pkg", |
|
|
|
|
"./test/fixtures/package-json" |
|
|
|
|
).unwrap()); |
|
|
|
|
} |
|
|
|
|