diff options
Diffstat (limited to 'cli/tests/unit/http_test.ts')
-rw-r--r-- | cli/tests/unit/http_test.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts index 201ca1269..680531876 100644 --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -803,8 +803,6 @@ unitTest( { perms: { net: true } }, async function httpServerIncompleteMessage() { const listener = Deno.listen({ port: 4501 }); - const def1 = deferred(); - const def2 = deferred(); const client = await Deno.connect({ port: 4501 }); await client.write(new TextEncoder().encode( @@ -830,23 +828,21 @@ unitTest( const errors: Error[] = []; - writeResponse() + const writePromise = writeResponse() .catch((error: Error) => { errors.push(error); - }) - .then(() => def1.resolve()); + }); const res = new Response(readable); - respondWith(res) - .catch((error: Error) => errors.push(error)) - .then(() => def2.resolve()); + const respondPromise = respondWith(res) + .catch((error: Error) => errors.push(error)); client.close(); await Promise.all([ - def1, - def2, + writePromise, + respondPromise, ]); listener.close(); |