Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

WIP: Using holochain nodejs instead of hcshell #87

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ fn setup_test_folder(path: &PathBuf, test_folder: &str) -> DefaultResult<()> {
let tests_path = path.join(test_folder);
fs::create_dir_all(tests_path.clone())?;
create_test_file(&tests_path, "index.js", include_str!("js-tests-scaffold/index.js"))?;
create_test_file(&tests_path, "package-lock.json", include_str!("js-tests-scaffold/package-lock.json"))?;
create_test_file(&tests_path, "package.json", include_str!("js-tests-scaffold/package.json"))?;
create_test_file(&tests_path, "README.md", include_str!("js-tests-scaffold/README.md"))?;
create_test_file(&tests_path, "webpack.config.js", include_str!("js-tests-scaffold/webpack.config.js"))?;
Ok(())
}

Expand Down Expand Up @@ -117,8 +115,6 @@ pub mod tests {

assert!(dir_path_buf.join(&TEST_DIR_NAME).join("index.js").exists());
assert!(dir_path_buf.join(&TEST_DIR_NAME).join("package.json").exists());
assert!(dir_path_buf.join(&TEST_DIR_NAME).join("package-lock.json").exists());
assert!(dir_path_buf.join(&TEST_DIR_NAME).join("webpack.config.js").exists());
assert!(dir_path_buf.join(&TEST_DIR_NAME).join("README.md").exists());
}
}
2 changes: 1 addition & 1 deletion src/cli/js-tests-scaffold
6 changes: 3 additions & 3 deletions src/cli/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ pub fn test(
)?;
}

// execute the built test file using hcshell
// execute the built test file using node
println!("{} tests in {}", "Running".green().bold(), testfile,);
util::run_cmd(
path.to_path_buf(),
"hcshell".to_string(),
"node".to_string(),
vec![testfile.to_string()],
)?;

Expand Down Expand Up @@ -153,7 +153,7 @@ pub mod tests {
false,
);

// is err because "hcshell test/dist/index.js" will have failed
// is err because "node test/dist/index.js" will have failed
// but the important thing is that the npm calls weren't made
assert!(result.is_err());
// check success of packaging step
Expand Down