diff options
Diffstat (limited to 'cli/tests/testdata/run/tls_starttls.js')
-rw-r--r-- | cli/tests/testdata/run/tls_starttls.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tests/testdata/run/tls_starttls.js b/cli/tests/testdata/run/tls_starttls.js index ecf344211..4acc21461 100644 --- a/cli/tests/testdata/run/tls_starttls.js +++ b/cli/tests/testdata/run/tls_starttls.js @@ -1,4 +1,3 @@ -import { deferred } from "../../../../test_util/std/async/deferred.ts"; import { assert, assertEquals, @@ -10,7 +9,7 @@ import { TextProtoReader } from "./textproto.ts"; const encoder = new TextEncoder(); const decoder = new TextDecoder(); -const resolvable = deferred(); +const { promise, resolve } = Promise.withResolvers(); const hostname = "localhost"; const port = 3504; @@ -33,7 +32,7 @@ listener.accept().then( // TODO(bartlomieju): this might be a bug setTimeout(() => { conn.close(); - resolvable.resolve(); + resolve(); }, 0); }, ); @@ -64,6 +63,6 @@ await r.readFull(bodyBuf); assertEquals(decoder.decode(bodyBuf), "Hello World\n"); conn.close(); listener.close(); -await resolvable; +await promise; console.log("DONE"); |