summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/40_bench.js5
-rw-r--r--cli/js/40_test.js5
2 files changed, 10 insertions, 0 deletions
diff --git a/cli/js/40_bench.js b/cli/js/40_bench.js
index e1373c990..a94c782fc 100644
--- a/cli/js/40_bench.js
+++ b/cli/js/40_bench.js
@@ -47,6 +47,11 @@ function bench(
optionsOrFn,
maybeFn,
) {
+ // No-op if we're not running in `deno bench` subcommand.
+ if (typeof op_register_bench !== "function") {
+ return;
+ }
+
if (!registeredWarmupBench) {
registeredWarmupBench = true;
const warmupBenchDesc = {
diff --git a/cli/js/40_test.js b/cli/js/40_test.js
index 2e448e847..d93228940 100644
--- a/cli/js/40_test.js
+++ b/cli/js/40_test.js
@@ -198,6 +198,11 @@ function testInner(
maybeFn,
overrides = {},
) {
+ // No-op if we're not running in `deno test` subcommand.
+ if (typeof op_register_test !== "function") {
+ return;
+ }
+
let testDesc;
const defaults = {
ignore: false,