Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: allow execute custom test command #550

Merged
merged 10 commits into from
Jul 29, 2021
Prev Previous commit
Next Next commit
add default valut for test in [scripts]
  • Loading branch information
fanatid committed Jul 28, 2021
commit 8364400ad1c23a2fd5fb86852028bf29ad59d172
11 changes: 10 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,16 @@ fn init(cfg_override: &ConfigOverride, name: String, typescript: bool) -> Result
std::env::set_current_dir(&name)?;
fs::create_dir("app")?;

let cfg = Config::default();
let mut cfg = Config::default();
cfg.scripts.insert(
"test".to_owned(),
if typescript {
"ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
} else {
"mocha -t 1000000 tests/"
}
.to_owned(),
);
let toml = cfg.to_string();
let mut file = File::create("Anchor.toml")?;
file.write_all(toml.as_bytes())?;
Expand Down