summaryrefslogtreecommitdiff
path: root/js/fetch_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/fetch_test.ts')
-rw-r--r--js/fetch_test.ts25
1 files changed, 4 insertions, 21 deletions
diff --git a/js/fetch_test.ts b/js/fetch_test.ts
index 2f73544aa..f92968d78 100644
--- a/js/fetch_test.ts
+++ b/js/fetch_test.ts
@@ -26,16 +26,6 @@ testPerm({ net: true }, async function fetchHeaders() {
assert(headers.get("Server").startsWith("SimpleHTTP"));
});
-test(async function headersAppend() {
- let err;
- try {
- const headers = new Headers([["foo", "bar", "baz"]]);
- } catch (e) {
- err = e;
- }
- assert(err instanceof TypeError);
-});
-
testPerm({ net: true }, async function fetchBlob() {
const response = await fetch("http://localhost:4545/package.json");
const headers = response.headers;
@@ -69,14 +59,10 @@ test(function newHeaderTest() {
try {
new Headers(null);
} catch (e) {
- assertEqual(e.message, "Failed to construct 'Headers': Invalid value");
- }
-
- try {
- const init = [["a", "b", "c"]];
- new Headers(init);
- } catch (e) {
- assertEqual(e.message, "Failed to construct 'Headers': Invalid value");
+ assertEqual(
+ e.message,
+ "Failed to construct 'Headers'; The provided value was not valid"
+ );
}
});
@@ -163,7 +149,6 @@ test(function headerGetSuccess() {
test(function headerEntriesSuccess() {
const headers = new Headers(headerDict);
const iterators = headers.entries();
- assertEqual(Object.prototype.toString.call(iterators), "[object Iterator]");
for (const it of iterators) {
const key = it[0];
const value = it[1];
@@ -175,7 +160,6 @@ test(function headerEntriesSuccess() {
test(function headerKeysSuccess() {
const headers = new Headers(headerDict);
const iterators = headers.keys();
- assertEqual(Object.prototype.toString.call(iterators), "[object Iterator]");
for (const it of iterators) {
assert(headers.has(it));
}
@@ -189,7 +173,6 @@ test(function headerValuesSuccess() {
for (const pair of entries) {
values.push(pair[1]);
}
- assertEqual(Object.prototype.toString.call(iterators), "[object Iterator]");
for (const it of iterators) {
assert(values.includes(it));
}