summaryrefslogtreecommitdiff
path: root/tests/testdata/run/078_unload_on_exit.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testdata/run/078_unload_on_exit.ts')
-rw-r--r--tests/testdata/run/078_unload_on_exit.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/testdata/run/078_unload_on_exit.ts b/tests/testdata/run/078_unload_on_exit.ts
new file mode 100644
index 000000000..43d33eb25
--- /dev/null
+++ b/tests/testdata/run/078_unload_on_exit.ts
@@ -0,0 +1,9 @@
+window.onunload = () => {
+ console.log("onunload is called");
+ // This second exit call doesn't trigger unload event,
+ // and therefore actually stops the process.
+ Deno.exit(1);
+ console.log("This doesn't show up in console");
+};
+// This exit call triggers the above unload event handler.
+Deno.exit(0);