diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2020-03-24 20:56:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 23:56:40 -0400 |
commit | 5d7bcf86fdb2bfcee0bfac24aeb7aeecb8b3faca (patch) | |
tree | 07e3f9b315253c27924687100a6e1891768696dc /cli/tests | |
parent | 3938071e91e7c3dcf7b4e727601e1e99005aceab (diff) |
feat: window.close() (#4474)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/058_tasks_microtasks_close.ts | 18 | ||||
-rw-r--r-- | cli/tests/058_tasks_microtasks_close.ts.out | 6 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 5 |
3 files changed, 29 insertions, 0 deletions
diff --git a/cli/tests/058_tasks_microtasks_close.ts b/cli/tests/058_tasks_microtasks_close.ts new file mode 100644 index 000000000..11de55a38 --- /dev/null +++ b/cli/tests/058_tasks_microtasks_close.ts @@ -0,0 +1,18 @@ +console.log("sync 1"); +setTimeout(() => { + console.log("setTimeout 1"); + Promise.resolve().then(() => { + console.log("Promise resolve in setTimeout 1"); + }); +}); +Promise.resolve().then(() => { + console.log("promise 1"); +}); +window.close(); +console.log("sync 2"); +setTimeout(() => { + console.log("setTimeout 2"); +}); +setTimeout(() => { + console.log("setTimeout 3"); +}, 100); diff --git a/cli/tests/058_tasks_microtasks_close.ts.out b/cli/tests/058_tasks_microtasks_close.ts.out new file mode 100644 index 000000000..218273cab --- /dev/null +++ b/cli/tests/058_tasks_microtasks_close.ts.out @@ -0,0 +1,6 @@ +sync 1 +sync 2 +promise 1 +setTimeout 1 +Promise resolve in setTimeout 1 +setTimeout 2 diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 02c46840e..f8651869b 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1078,6 +1078,11 @@ itest!(_057_revoke_permissions { output: "057_revoke_permissions.out", }); +itest!(_058_tasks_microtasks_close { + args: "run 058_tasks_microtasks_close.ts", + output: "058_tasks_microtasks_close.ts.out", +}); + itest!(js_import_detect { args: "run --reload js_import_detect.ts", output: "js_import_detect.ts.out", |