|
|
|
@ -86,12 +86,13 @@ fn it_creates_a_package_json_default_path() { |
|
|
|
|
utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
assert_eq!(pkg.name, "js-hello-world"); |
|
|
|
|
assert_eq!(pkg.ty, "module"); |
|
|
|
|
assert_eq!(pkg.repository.ty, "git"); |
|
|
|
|
assert_eq!( |
|
|
|
|
pkg.repository.url, |
|
|
|
|
"https://github.com/rustwasm/wasm-pack.git" |
|
|
|
|
); |
|
|
|
|
assert_eq!(pkg.module, "js_hello_world.js"); |
|
|
|
|
assert_eq!(pkg.main, "js_hello_world.js"); |
|
|
|
|
assert_eq!(pkg.types, "js_hello_world.d.ts"); |
|
|
|
|
assert_eq!( |
|
|
|
|
pkg.side_effects, |
|
|
|
@ -125,7 +126,8 @@ fn it_creates_a_package_json_provided_path() { |
|
|
|
|
utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
assert_eq!(pkg.name, "js-hello-world"); |
|
|
|
|
assert_eq!(pkg.module, "js_hello_world.js"); |
|
|
|
|
assert_eq!(pkg.ty, "module"); |
|
|
|
|
assert_eq!(pkg.main, "js_hello_world.js"); |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
@ -154,7 +156,8 @@ fn it_creates_a_package_json_provided_path_with_scope() { |
|
|
|
|
utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
assert_eq!(pkg.name, "@test/js-hello-world"); |
|
|
|
|
assert_eq!(pkg.module, "js_hello_world.js"); |
|
|
|
|
assert_eq!(pkg.ty, "module"); |
|
|
|
|
assert_eq!(pkg.main, "js_hello_world.js"); |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
@ -251,12 +254,13 @@ fn it_creates_a_package_json_with_correct_files_when_out_name_is_provided() { |
|
|
|
|
utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
assert_eq!(pkg.name, "js-hello-world"); |
|
|
|
|
assert_eq!(pkg.ty, "module"); |
|
|
|
|
assert_eq!(pkg.repository.ty, "git"); |
|
|
|
|
assert_eq!( |
|
|
|
|
pkg.repository.url, |
|
|
|
|
"https://github.com/rustwasm/wasm-pack.git" |
|
|
|
|
); |
|
|
|
|
assert_eq!(pkg.module, "index.js"); |
|
|
|
|
assert_eq!(pkg.main, "index.js"); |
|
|
|
|
assert_eq!(pkg.types, "index.d.ts"); |
|
|
|
|
assert_eq!(pkg.side_effects, vec!["./index.js", "./snippets/*"]); |
|
|
|
|
|
|
|
|
@ -298,12 +302,13 @@ fn it_creates_a_package_json_with_correct_keys_when_types_are_skipped() { |
|
|
|
|
utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
let pkg = utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); |
|
|
|
|
assert_eq!(pkg.name, "js-hello-world"); |
|
|
|
|
assert_eq!(pkg.ty, "module"); |
|
|
|
|
assert_eq!(pkg.repository.ty, "git"); |
|
|
|
|
assert_eq!( |
|
|
|
|
pkg.repository.url, |
|
|
|
|
"https://github.com/rustwasm/wasm-pack.git" |
|
|
|
|
); |
|
|
|
|
assert_eq!(pkg.module, "js_hello_world.js"); |
|
|
|
|
assert_eq!(pkg.main, "js_hello_world.js"); |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
@ -344,7 +349,7 @@ fn it_creates_a_package_json_with_npm_dependencies_provided_by_wasm_bindgen() { |
|
|
|
|
pkg.repository.url, |
|
|
|
|
"https://github.com/rustwasm/wasm-pack.git" |
|
|
|
|
); |
|
|
|
|
assert_eq!(pkg.module, "js_hello_world.js"); |
|
|
|
|
assert_eq!(pkg.main, "js_hello_world.js"); |
|
|
|
|
|
|
|
|
|
let actual_files: HashSet<String> = pkg.files.into_iter().collect(); |
|
|
|
|
let expected_files: HashSet<String> = [ |
|
|
|
|