summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/run/onload/nest_imported.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/run/onload/nest_imported.ts')
-rw-r--r--cli/tests/testdata/run/onload/nest_imported.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/tests/testdata/run/onload/nest_imported.ts b/cli/tests/testdata/run/onload/nest_imported.ts
index 351a3cb22..a942d2729 100644
--- a/cli/tests/testdata/run/onload/nest_imported.ts
+++ b/cli/tests/testdata/run/onload/nest_imported.ts
@@ -2,10 +2,11 @@
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
const handler = (e: Event) => {
- assert(!e.cancelable);
+ assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
console.log(`got ${e.type} event in event handler (nest_imported)`);
};
window.addEventListener("load", handler);
+window.addEventListener("beforeunload", handler);
window.addEventListener("unload", handler);
console.log("log from nest_imported script");