diff options
Diffstat (limited to 'cli/tests/testdata/run/onload/imported.ts')
| -rw-r--r-- | cli/tests/testdata/run/onload/imported.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/testdata/run/onload/imported.ts b/cli/tests/testdata/run/onload/imported.ts new file mode 100644 index 000000000..969f97e56 --- /dev/null +++ b/cli/tests/testdata/run/onload/imported.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-window-prefix +import { assert } from "../../../../../test_util/std/testing/asserts.ts"; +import "./nest_imported.ts"; + +const handler = (e: Event) => { + 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"); |
