diff options
author | Luca Casonato <hello@lcas.dev> | 2022-12-19 15:18:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-19 15:18:14 +0100 |
commit | d1f6b519907d3778f02436cf1fcc4f94f563acf8 (patch) | |
tree | dd21e37519dfd3164ca7bfcc017bb7b60110445b | |
parent | 43b6390629ad62edbeca3b884ccee53422876a1a (diff) |
test(ext/fetch): fix test in release mode (#17125)
-rw-r--r-- | cli/tests/unit/fetch_test.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index 7035fe444..b755e8ec9 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -1837,9 +1837,11 @@ Deno.test( const server = (async () => { const conn = await listener.accept(); listener.close(); - const buf = new Uint8Array(160); + const buf = new Uint8Array(256); const n = await conn.read(buf); - assertEquals(n, 160); // this is the request headers + first body chunk + const data = new TextDecoder().decode(buf.subarray(0, n!)); // this is the request headers + first body chunk + assert(data.startsWith("POST / HTTP/1.1\r\n")); + assert(data.endsWith("1\r\na\r\n")); const n2 = await conn.read(buf); assertEquals(n2, 6); // this is the second body chunk const n3 = await conn.read(buf); |