From a03f1b5b64eb6e1e276b6d4b9f4864cb761c38f3 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 11 Aug 2023 16:32:41 +0530 Subject: [PATCH] add test --- cli/tests/unit_node/zlib_test.ts | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/cli/tests/unit_node/zlib_test.ts b/cli/tests/unit_node/zlib_test.ts index b37f73861c60e5..7c5b8dc86944c9 100644 --- a/cli/tests/unit_node/zlib_test.ts +++ b/cli/tests/unit_node/zlib_test.ts @@ -14,6 +14,7 @@ import { createDeflate, } from "node:zlib"; import { Buffer } from "node:buffer"; +import { PassThrough } from "node:stream"; import { createReadStream, createWriteStream } from "node:fs"; Deno.test("brotli compression sync", () => { @@ -62,8 +63,19 @@ Deno.test("brotli compression", async () => { } }); -Deno.test("zlib create deflate with dictionary", () => { - createDeflate({ - dictionary: Buffer.alloc(0), - }); -}); +Deno.test( + "zlib create deflate with dictionary", + { sanitizeResources: false }, + async () => { + const promise = deferred(); + const handle = createDeflate({ + dictionary: Buffer.alloc(0), + }); + + handle.on("close", () => promise.resolve()); + handle.end(); + handle.destroy(); + + await promise; + }, +);