diff options
Diffstat (limited to 'cli/tests/unit/flash_test.ts')
-rw-r--r-- | cli/tests/unit/flash_test.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/tests/unit/flash_test.ts b/cli/tests/unit/flash_test.ts index 375fdb8f3..e2e64dfe3 100644 --- a/cli/tests/unit/flash_test.ts +++ b/cli/tests/unit/flash_test.ts @@ -2227,6 +2227,32 @@ Deno.test( }, ); +Deno.test( + { permissions: { net: true } }, + async function serveWithPromisePrototypeThenOverride() { + const originalThen = Promise.prototype.then; + try { + Promise.prototype.then = () => { + throw new Error(); + }; + const ac = new AbortController(); + const listeningPromise = deferred(); + const server = Deno.serve({ + handler: (_req) => new Response("ok"), + hostname: "localhost", + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + ac.abort(); + await server; + } finally { + Promise.prototype.then = originalThen; + } + }, +); + // https://github.com/denoland/deno/issues/15549 Deno.test( { permissions: { net: true } }, |