diff options
Diffstat (limited to 'tests/unit/http_test.ts')
-rw-r--r-- | tests/unit/http_test.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/unit/http_test.ts b/tests/unit/http_test.ts index 03c30965f..eddb1520b 100644 --- a/tests/unit/http_test.ts +++ b/tests/unit/http_test.ts @@ -2572,11 +2572,9 @@ for (const compression of [true, false]) { const result = await reader.read(); assert(!result.done); assertEquals(result.value, new Uint8Array([65])); - await assertRejects( - () => reader.read(), - TypeError, - "body", - ); + const err = await assertRejects(() => reader.read()); + assert(err instanceof TypeError); + assert(err.message.includes("error decoding response body")); const httpConn = await server; httpConn.close(); @@ -2610,11 +2608,9 @@ for (const compression of [true, false]) { const result = await reader.read(); assert(!result.done); assertEquals(result.value, new Uint8Array([65])); - await assertRejects( - () => reader.read(), - TypeError, - "body", - ); + const err = await assertRejects(() => reader.read()); + assert(err instanceof TypeError); + assert(err.message.includes("error decoding response body")); const httpConn = await server; httpConn.close(); |