diff options
| author | Matt Ezell <ezell.matt@gmail.com> | 2022-10-13 03:47:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-13 10:47:47 +0200 |
| commit | 06ccb6d41e1b89bff587a6dbac698c912d1c1090 (patch) | |
| tree | b886344c2212aefdf84594829c43a3a0d565fdce /cli/tests/testdata/run/onload/nest_imported.ts | |
| parent | ba3d0da6ab3ff5f7e0a09b132b6ae113a8c8b782 (diff) | |
chore: Added onbeforeunload to window type definition (#16251)
Diffstat (limited to 'cli/tests/testdata/run/onload/nest_imported.ts')
| -rw-r--r-- | cli/tests/testdata/run/onload/nest_imported.ts | 3 |
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"); |
