diff options
Diffstat (limited to 'test/js/web/fetch/fetch.stream.test.ts')
-rw-r--r-- | test/js/web/fetch/fetch.stream.test.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/js/web/fetch/fetch.stream.test.ts b/test/js/web/fetch/fetch.stream.test.ts index 82c63ba53..cc518e397 100644 --- a/test/js/web/fetch/fetch.stream.test.ts +++ b/test/js/web/fetch/fetch.stream.test.ts @@ -213,7 +213,12 @@ describe("fetch() with streaming", () => { .listen(0); const address = server.address() as AddressInfo; - const url = `http://${address.address}:${address.port}`; + let url; + if (address.family == "IPv4") { + url = `http://${address.address}:${address.port}`; + } else { + url = `http://[${address.address}]:${address.port}`; + } async function getRequestLen(url: string) { const response = await fetch(url); const hasBody = response.body; |