1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

test(ext/fetch): fix test in release mode (#17125)

This commit is contained in:
Luca Casonato 2022-12-19 15:18:14 +01:00 committed by Bartek Iwańczuk
parent c059c12a1e
commit a9c0c20d1c
No known key found for this signature in database
GPG key ID: 0C6BCDDC3B3AD750

View file

@ -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);