From d043dd86f73f93691c9d9032b38ac94ac16a8793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 24 Mar 2024 23:16:45 +0000 Subject: 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 --- cli/js/40_test.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/js/40_test.js') 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, -- cgit v1.2.3