summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/zlib_test.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2023-11-22 22:11:20 +1100
committerGitHub <noreply@github.com>2023-11-22 12:11:20 +0100
commit616354e76cba0be8af20a0ffefeacfcf6101bafc (patch)
treec832c81dd93498e196840c8d59c0a4ab76396d07 /cli/tests/unit_node/zlib_test.ts
parent0ffcb46e0f60110c07e21151db6066f5a1b5f710 (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/unit_node/zlib_test.ts')
-rw-r--r--cli/tests/unit_node/zlib_test.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/tests/unit_node/zlib_test.ts b/cli/tests/unit_node/zlib_test.ts
index b878b7cc3..c025849da 100644
--- a/cli/tests/unit_node/zlib_test.ts
+++ b/cli/tests/unit_node/zlib_test.ts
@@ -4,7 +4,6 @@ import {
assert,
assertEquals,
} from "../../../test_util/std/testing/asserts.ts";
-import { deferred } from "../../../test_util/std/async/deferred.ts";
import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts";
import {
brotliCompressSync,
@@ -24,7 +23,7 @@ Deno.test("brotli compression sync", () => {
});
Deno.test("brotli compression", async () => {
- const promise = deferred();
+ const { promise, resolve } = Promise.withResolvers<void>();
const compress = createBrotliCompress();
const filePath = relative(
Deno.cwd(),
@@ -43,7 +42,7 @@ Deno.test("brotli compression", async () => {
const stream2 = input2.pipe(decompress).pipe(output2);
stream2.on("finish", () => {
- promise.resolve();
+ resolve();
});
});
@@ -73,12 +72,12 @@ Deno.test(
"zlib create deflate with dictionary",
{ sanitizeResources: false },
async () => {
- const promise = deferred();
+ const { promise, resolve } = Promise.withResolvers<void>();
const handle = createDeflate({
dictionary: Buffer.alloc(0),
});
- handle.on("close", () => promise.resolve());
+ handle.on("close", () => resolve());
handle.end();
handle.destroy();