summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/40_testing.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/cli/js/40_testing.js b/cli/js/40_testing.js
index 81fedb83e..4f8153f5a 100644
--- a/cli/js/40_testing.js
+++ b/cli/js/40_testing.js
@@ -7,11 +7,13 @@
const core = globalThis.Deno.core;
const ops = core.ops;
-import { setExitHandler } from "ext:runtime/30_os.js";
-import { Console } from "ext:deno_console/01_console.js";
-import { serializePermissions } from "ext:runtime/10_permissions.js";
-import { setTimeout } from "ext:deno_web/02_timers.js";
-import { assert } from "ext:deno_web/00_infra.js";
+
+const internals = globalThis.__bootstrap.internals;
+const {
+ setExitHandler,
+ Console,
+ serializePermissions,
+} = internals;
const opSanitizerDelayResolveQueue = [];
let hasSetOpSanitizerDelayMacrotask = false;
@@ -445,8 +447,7 @@ function assertResources(fn) {
function assertExit(fn, isTest) {
return async function exitSanitizer(...params) {
setExitHandler((exitCode) => {
- assert(
- false,
+ throw new Error(
`${
isTest ? "Test case" : "Bench"
} attempted to exit with exit code: ${exitCode}`,
@@ -1155,8 +1156,7 @@ function wrapBenchmark(desc) {
if (desc.sanitizeExit) {
setExitHandler((exitCode) => {
- assert(
- false,
+ throw new Error(
`Bench attempted to exit with exit code: ${exitCode}`,
);
});