summaryrefslogtreecommitdiff
path: root/cli/tools/init/mod.rs
diff options
context:
space:
mode:
authorsigmaSd <bedisnbiba@gmail.com>2022-12-10 00:34:08 +0100
committerGitHub <noreply@github.com>2022-12-10 00:34:08 +0100
commit4eb8e875fd6fc91ff1dbc34b7bc8750fff728a32 (patch)
treeb09468ef1031e0c7046bfab28aee411bdafcc7ef /cli/tools/init/mod.rs
parent6794d9fe5d3d401e6e5795a502f8d1ee63fb796b (diff)
feat(init): Generate main_bench.ts by default (#16786)
This commit changes "deno init" to generate "main_bench.ts" file which scaffold two example bench cases.
Diffstat (limited to 'cli/tools/init/mod.rs')
-rw-r--r--cli/tools/init/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/tools/init/mod.rs b/cli/tools/init/mod.rs
index 96b5b9a46..bb11dba69 100644
--- a/cli/tools/init/mod.rs
+++ b/cli/tools/init/mod.rs
@@ -40,6 +40,8 @@ pub async fn init_project(init_flags: InitFlags) -> Result<(), AnyError> {
let main_test_ts = include_str!("./templates/main_test.ts")
.replace("{CURRENT_STD_URL}", deno_std::CURRENT_STD_URL.as_str());
create_file(&dir, "main_test.ts", &main_test_ts)?;
+ let main_bench_ts = include_str!("./templates/main_bench.ts");
+ create_file(&dir, "main_bench.ts", main_bench_ts)?;
create_file(&dir, "deno.jsonc", include_str!("./templates/deno.jsonc"))?;
@@ -62,5 +64,8 @@ pub async fn init_project(init_flags: InitFlags) -> Result<(), AnyError> {
info!("");
info!(" {}", colors::gray("// Run the tests"));
info!(" deno test");
+ info!("");
+ info!(" {}", colors::gray("// Run the benchmarks"));
+ info!(" deno bench");
Ok(())
}