diff options
Diffstat (limited to 'cli/tests/034_onload/imported.ts')
-rw-r--r-- | cli/tests/034_onload/imported.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cli/tests/034_onload/imported.ts b/cli/tests/034_onload/imported.ts index 5cf2d7b4c..d71f9d654 100644 --- a/cli/tests/034_onload/imported.ts +++ b/cli/tests/034_onload/imported.ts @@ -1,8 +1,11 @@ +import { assert } from "../../../js/deps/https/deno.land/std/testing/asserts.ts"; import "./nest_imported.ts"; -window.addEventListener( - "load", - (e: Event): void => { - console.log(`got ${e.type} event in event handler (imported)`); - } -); + +const handler = (e: Event): void => { + assert(!e.cancelable); + console.log(`got ${e.type} event in event handler (imported)`); +}; + +window.addEventListener("load", handler); +window.addEventListener("unload", handler); console.log("log from imported script"); |