|
|
|
@ -97,8 +97,9 @@ fn it_creates_a_package_json_default_path() { |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.d.ts", |
|
|
|
|
"js_hello_world_bg.js", |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.js", |
|
|
|
|
] |
|
|
|
|
.iter() |
|
|
|
@ -125,8 +126,9 @@ fn it_creates_a_package_json_provided_path() { |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.d.ts", |
|
|
|
|
"js_hello_world_bg.js", |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.js", |
|
|
|
|
] |
|
|
|
|
.iter() |
|
|
|
@ -153,8 +155,9 @@ fn it_creates_a_package_json_provided_path_with_scope() { |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.d.ts", |
|
|
|
|
"js_hello_world_bg.js", |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.js", |
|
|
|
|
] |
|
|
|
|
.iter() |
|
|
|
@ -188,7 +191,6 @@ fn it_creates_a_pkg_json_with_correct_files_on_node() { |
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world_bg.js", |
|
|
|
|
"js_hello_world.d.ts", |
|
|
|
|
"js_hello_world.js", |
|
|
|
|
] |
|
|
|
@ -222,9 +224,9 @@ fn it_creates_a_pkg_json_with_correct_files_on_nomodules() { |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|
"js_hello_world.d.ts", |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world.js", |
|
|
|
|
"js_hello_world.d.ts", |
|
|
|
|
] |
|
|
|
|
.iter() |
|
|
|
|
.map(|&s| String::from(s)) |
|
|
|
@ -256,10 +258,11 @@ fn it_creates_a_package_json_with_correct_files_when_out_name_is_provided() { |
|
|
|
|
assert_eq!(pkg.side_effects, false); |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = ["index_bg.wasm", "index.d.ts", "index.js"] |
|
|
|
|
.iter() |
|
|
|
|
.map(|&s| String::from(s)) |
|
|
|
|
.collect(); |
|
|
|
|
let expected_files: HashSet<String> = |
|
|
|
|
["index_bg.wasm", "index_bg.js", "index.d.ts", "index.js"] |
|
|
|
|
.iter() |
|
|
|
|
.map(|&s| String::from(s)) |
|
|
|
|
.collect(); |
|
|
|
|
assert_eq!(actual_files, expected_files); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -300,10 +303,14 @@ fn it_creates_a_package_json_with_correct_keys_when_types_are_skipped() { |
|
|
|
|
assert_eq!(pkg.module, "js_hello_world.js"); |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = ["js_hello_world_bg.wasm", "js_hello_world.js"] |
|
|
|
|
.iter() |
|
|
|
|
.map(|&s| String::from(s)) |
|
|
|
|
.collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|
"js_hello_world_bg.wasm", |
|
|
|
|
"js_hello_world_bg.js", |
|
|
|
|
"js_hello_world.js", |
|
|
|
|
] |
|
|
|
|
.iter() |
|
|
|
|
.map(|&s| String::from(s)) |
|
|
|
|
.collect(); |
|
|
|
|
assert_eq!(actual_files, expected_files); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|