summaryrefslogtreecommitdiff
path: root/tests/unit/test_util.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-05-28 21:46:04 +0100
committerGitHub <noreply@github.com>2024-05-28 22:46:04 +0200
commit7d8a8a04614cd3a9ef57569505ae6eb728869ecd (patch)
treef5349b834879684d9cb54459018dd93dac9a602d /tests/unit/test_util.ts
parent69da5d8290fda4797af5e3b3e5e7bf3c0141f203 (diff)
fix(ext/http): flush gzip streaming response (#23991)
This commit changes `gzip` compression in `Deno.serve` API to flush data after each write. There's a slight performance regression, but provided test shows a scenario that was not possible before. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'tests/unit/test_util.ts')
-rw-r--r--tests/unit/test_util.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/unit/test_util.ts b/tests/unit/test_util.ts
index ba9bf1839..db2585ebd 100644
--- a/tests/unit/test_util.ts
+++ b/tests/unit/test_util.ts
@@ -35,14 +35,9 @@ export function execCode(code: string): Promise<readonly [number, string]> {
return execCode2(code).finished();
}
-export function execCode2(code: string) {
- const command = new Deno.Command(Deno.execPath(), {
- args: [
- "eval",
- "--unstable",
- "--no-check",
- code,
- ],
+export function execCode3(cmd: string, args: string[]) {
+ const command = new Deno.Command(cmd, {
+ args,
stdout: "piped",
stderr: "inherit",
});
@@ -82,6 +77,10 @@ export function execCode2(code: string) {
};
}
+export function execCode2(code: string) {
+ return execCode3(Deno.execPath(), ["eval", "--unstable", "--no-check", code]);
+}
+
export function tmpUnixSocketPath(): string {
const folder = Deno.makeTempDirSync();
return join(folder, "socket");