fork of https://github.com/rustwasm/wasm-pack for the needs of NextGraph.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
wasm-pack/tests/wasm-pack.rs

32 lines
952 B

extern crate dir_diff;
extern crate wasm_pack;
#[test]
fn it_gets_the_crate_name_default_path() {
assert!(wasm_pack::get_crate_name(".").is_ok());
assert_eq!(wasm_pack::get_crate_name(".").unwrap(), "wasm-pack");
}
#[test]
fn it_gets_the_crate_name_provided_path() {
assert!(wasm_pack::get_crate_name("./examples/js-hello-world").is_ok());
assert_eq!(
wasm_pack::get_crate_name("./examples/js-hello-world").unwrap(),
"js-hello-world"
);
}
#[test]
fn it_creates_a_package_json_default_path() {
assert!(wasm_pack::write_package_json(".").is_ok());
assert!(!dir_diff::is_different("./pkg", "./test/fixtures/package-json").unwrap());
}
#[test]
fn it_creates_a_package_json_provided_path() {
assert!(wasm_pack::write_package_json("./examples/js-hello-world").is_ok());
assert!(!dir_diff::is_different(
"./examples/js-hello-world/pkg",
"./test/fixtures/package-json"
).unwrap());
}