Repository: ashleygwilliams/wasm-pack
Pull request #58 (2018-03-14 15:59:07)

clean up imports

ashleygwilliams: @steveklabnik looks like this needs a cargo fmt run

Patch:
diff --git a/tests/fixtures/js-hello-world/Cargo.lock b/examples/js-hello-world/Cargo.lock
similarity index 100%
rename from tests/fixtures/js-hello-world/Cargo.lock
rename to examples/js-hello-world/Cargo.lock
diff --git a/tests/fixtures/js-hello-world/Cargo.toml b/examples/js-hello-world/Cargo.toml
similarity index 100%
rename from tests/fixtures/js-hello-world/Cargo.toml
rename to examples/js-hello-world/Cargo.toml
diff --git a/tests/fixtures/js-hello-world/README.md b/examples/js-hello-world/README.md
similarity index 100%
rename from tests/fixtures/js-hello-world/README.md
rename to examples/js-hello-world/README.md
diff --git a/tests/fixtures/js-hello-world/src/lib.rs b/examples/js-hello-world/src/lib.rs
similarity index 100%
rename from tests/fixtures/js-hello-world/src/lib.rs
rename to examples/js-hello-world/src/lib.rs
diff --git a/tests/fixtures/no-readme/Cargo.lock b/examples/no-readme/Cargo.lock
similarity index 100%
rename from tests/fixtures/no-readme/Cargo.lock
rename to examples/no-readme/Cargo.lock
diff --git a/tests/fixtures/no-readme/Cargo.toml b/examples/no-readme/Cargo.toml
similarity index 100%
rename from tests/fixtures/no-readme/Cargo.toml
rename to examples/no-readme/Cargo.toml
diff --git a/tests/fixtures/no-readme/src/lib.rs b/examples/no-readme/src/lib.rs
similarity index 100%
rename from tests/fixtures/no-readme/src/lib.rs
rename to examples/no-readme/src/lib.rs
diff --git a/src/main.rs b/src/main.rs
index 070d715..b4dd5eb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,9 +1,8 @@
-extern crate console;
-extern crate failure;
+extern crate wasm_pack;
+
 extern crate indicatif;
 #[macro_use]
 extern crate quicli;
-extern crate wasm_pack;
 
 use std::time::Instant;
 


Test patch:
diff --git a/tests/manifest.rs b/tests/manifest.rs
index 223b06a..54f5a14 100644
--- a/tests/manifest.rs
+++ b/tests/manifest.rs
@@ -18,9 +18,9 @@ fn it_gets_the_crate_name_default_path() {
 
 #[test]
 fn it_gets_the_crate_name_provided_path() {
-    assert!(manifest::get_crate_name("tests/fixtures/js-hello-world").is_ok());
+    assert!(manifest::get_crate_name("./examples/js-hello-world").is_ok());
     assert_eq!(
-        manifest::get_crate_name("tests/fixtures/js-hello-world").unwrap(),
+        manifest::get_crate_name("./examples/js-hello-world").unwrap(),
         "js-hello-world"
     );
 }
@@ -45,7 +45,7 @@ fn it_creates_a_package_json_default_path() {
 
 #[test]
 fn it_creates_a_package_json_provided_path() {
-    let path = "tests/fixtures/js-hello-world".to_string();
+    let path = "./examples/js-hello-world".to_string();
     wasm_pack::create_pkg_dir(&path).unwrap();
     assert!(manifest::write_package_json(&path).is_ok());
     let package_json_path = format!("{}/pkg/package.json", &path);
diff --git a/tests/readme.rs b/tests/readme.rs
index fac3f8a..4e3b6a3 100644
--- a/tests/readme.rs
+++ b/tests/readme.rs
@@ -21,7 +21,7 @@ fn it_copies_a_readme_default_path() {
 
 #[test]
 fn it_creates_a_package_json_provided_path() {
-    let path = "tests/fixtures/js-hello-world".to_string();
+    let path = "./examples/js-hello-world".to_string();
     assert!(readme::copy_from_crate(&path).is_ok());
     let crate_readme_path = format!("{}/README.md", &path);
     let pkg_readme_path = format!("{}/pkg/README.md", &path);