parent
a5a4f8b324
commit
edb8e1ef72
@ -1,30 +1,32 @@ |
|||||||
extern crate dir_diff; |
extern crate dir_diff; |
||||||
extern crate wasm_pack; |
extern crate wasm_pack; |
||||||
|
|
||||||
|
use wasm_pack::manifest; |
||||||
|
|
||||||
#[test] |
#[test] |
||||||
fn it_gets_the_crate_name_default_path() { |
fn it_gets_the_crate_name_default_path() { |
||||||
assert!(wasm_pack::get_crate_name(".").is_ok()); |
assert!(manifest::get_crate_name(".").is_ok()); |
||||||
assert_eq!(wasm_pack::get_crate_name(".").unwrap(), "wasm-pack"); |
assert_eq!(manifest::get_crate_name(".").unwrap(), "wasm-pack"); |
||||||
} |
} |
||||||
|
|
||||||
#[test] |
#[test] |
||||||
fn it_gets_the_crate_name_provided_path() { |
fn it_gets_the_crate_name_provided_path() { |
||||||
assert!(wasm_pack::get_crate_name("./examples/js-hello-world").is_ok()); |
assert!(manifest::get_crate_name("./examples/js-hello-world").is_ok()); |
||||||
assert_eq!( |
assert_eq!( |
||||||
wasm_pack::get_crate_name("./examples/js-hello-world").unwrap(), |
manifest::get_crate_name("./examples/js-hello-world").unwrap(), |
||||||
"js-hello-world" |
"js-hello-world" |
||||||
); |
); |
||||||
} |
} |
||||||
|
|
||||||
#[test] |
#[test] |
||||||
fn it_creates_a_package_json_default_path() { |
fn it_creates_a_package_json_default_path() { |
||||||
assert!(wasm_pack::write_package_json(".").is_ok()); |
assert!(manifest::write_package_json(".").is_ok()); |
||||||
assert!(!dir_diff::is_different("./pkg", "./test/fixtures/package-json").unwrap()); |
assert!(!dir_diff::is_different("./pkg", "./test/fixtures/package-json").unwrap()); |
||||||
} |
} |
||||||
|
|
||||||
#[test] |
#[test] |
||||||
fn it_creates_a_package_json_provided_path() { |
fn it_creates_a_package_json_provided_path() { |
||||||
assert!(wasm_pack::write_package_json("./examples/js-hello-world").is_ok()); |
assert!(manifest::write_package_json("./examples/js-hello-world").is_ok()); |
||||||
assert!(!dir_diff::is_different( |
assert!(!dir_diff::is_different( |
||||||
"./examples/js-hello-world/pkg", |
"./examples/js-hello-world/pkg", |
||||||
"./test/fixtures/package-json" |
"./test/fixtures/package-json" |
Loading…
Reference in new issue