diff options
author | Axetroy <axetroy.dev@gmail.com> | 2019-12-14 20:49:30 +0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-12-14 20:49:30 +0800 |
commit | 83f95fb8dfaed42eee3e1e0cd3a6e9b94f05ef2d (patch) | |
tree | d7d8db6caa3f47bb598c83cb4e489d1272840d35 /cli/js/fetch_test.ts | |
parent | 7e116dd70d7c194f2967d64e7700aae0bb17100f (diff) |
fetch support URL instance as input (#3496)
Diffstat (limited to 'cli/js/fetch_test.ts')
-rw-r--r-- | cli/js/fetch_test.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/js/fetch_test.ts b/cli/js/fetch_test.ts index 299cbe05f..4fc2339b6 100644 --- a/cli/js/fetch_test.ts +++ b/cli/js/fetch_test.ts @@ -42,6 +42,13 @@ testPerm({ net: true }, async function fetchUrl(): Promise<void> { assertEquals(response.url, "http://localhost:4545/cli/tests/fixture.json"); }); +testPerm({ net: true }, async function fetchURL(): Promise<void> { + const response = await fetch( + new URL("http://localhost:4545/cli/tests/fixture.json") + ); + assertEquals(response.url, "http://localhost:4545/cli/tests/fixture.json"); +}); + testPerm({ net: true }, async function fetchHeaders(): Promise<void> { const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); const headers = response.headers; |