diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2023-11-22 22:11:20 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-22 12:11:20 +0100 |
| commit | 616354e76cba0be8af20a0ffefeacfcf6101bafc (patch) | |
| tree | c832c81dd93498e196840c8d59c0a4ab76396d07 /cli/tests/testdata/run/tls_starttls.js | |
| parent | 0ffcb46e0f60110c07e21151db6066f5a1b5f710 (diff) | |
refactor: replace `deferred()` from `std/async` with `Promise.withResolvers()` (#21234)
Closes #21041
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
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"); |
