summaryrefslogtreecommitdiff
path: root/cli/js/40_test.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-03-24 23:16:45 +0000
committerGitHub <noreply@github.com>2024-03-24 16:16:45 -0700
commitd043dd86f73f93691c9d9032b38ac94ac16a8793 (patch)
tree575102a4f7652fdb6538ffcead590bedf67237b8 /cli/js/40_test.js
parentd263c632e3d5a91fd6f9fffc598128d87c5621cd (diff)
fix: don't panic in test and bench if ops not available (#23055)
Fixes regression introduced in https://github.com/denoland/deno/pull/22112 that removed checks if `Deno.test` or `Deno.bench` are not used in respective subcommands. Closes https://github.com/denoland/deno/issues/23041
Diffstat (limited to 'cli/js/40_test.js')
-rw-r--r--cli/js/40_test.js5
1 files changed, 5 insertions, 0 deletions
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,