diff options
Diffstat (limited to 'cli/tests/testdata/run/onload/imported.ts')
-rw-r--r-- | cli/tests/testdata/run/onload/imported.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/tests/testdata/run/onload/imported.ts b/cli/tests/testdata/run/onload/imported.ts index 969f97e56..f4157b86f 100644 --- a/cli/tests/testdata/run/onload/imported.ts +++ b/cli/tests/testdata/run/onload/imported.ts @@ -3,10 +3,11 @@ import { assert } from "../../../../../test_util/std/testing/asserts.ts"; import "./nest_imported.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 (imported)`); }; window.addEventListener("load", handler); +window.addEventListener("beforeunload", handler); window.addEventListener("unload", handler); console.log("log from imported script"); |