summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-01-25 14:54:35 -0500
committerGitHub <noreply@github.com>2024-01-25 14:54:35 -0500
commit7038074c8583465872b16083f54f2211312f0943 (patch)
tree71cfc7164d40b493cdd4800f130681bdf363ac45 /cli/worker.rs
parente06be89143e0cfc85896ee0b89f2e4cce8ba8d44 (diff)
chore(cli): split 40_testing (#22112)
No code changes -- just splitting 40_testing into three files and removing a couple of unused lines of code.
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index 4807e2699..e0f76716b 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -633,14 +633,20 @@ impl CliMainWorkerFactory {
);
if self.shared.subcommand.needs_test() {
- worker.js_runtime.lazy_load_es_module_from_code(
- "ext:cli/40_testing.js",
- deno_core::FastString::StaticAscii(include_str!("js/40_testing.js")),
- )?;
- worker.js_runtime.lazy_load_es_module_from_code(
- "ext:cli/40_jupyter.js",
- deno_core::FastString::StaticAscii(include_str!("js/40_jupyter.js")),
- )?;
+ macro_rules! test_file {
+ ($($file:literal),*) => {
+ $(worker.js_runtime.lazy_load_es_module_from_code(
+ concat!("ext:cli/", $file),
+ deno_core::FastString::StaticAscii(include_str!(concat!("js/", $file))),
+ )?;)*
+ }
+ }
+ test_file!(
+ "40_test_common.js",
+ "40_test.js",
+ "40_bench.js",
+ "40_jupyter.js"
+ );
}
Ok(CliMainWorker {