Skip to content

Commit

Permalink
wpt: update response-static-error.any.js (nodejs#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev authored and anonrig committed Apr 4, 2023
1 parent c3c0a50 commit 3c981a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/wpt/tests/fetch/api/response/response-static-error.any.js
Expand Up @@ -11,6 +11,18 @@ test(function() {
assert_true(responseError.headers.entries().next().done, "Headers should be empty");
}, "Check response returned by static method error()");

promise_test (async function() {
let response = await fetch("../resources/data.json");

try {
response.headers.append('name', 'value');
} catch (e) {
assert_equals(e.constructor.name, "TypeError");
}

assert_not_equals(response.headers.get("name"), "value", "response headers should be immutable");
}, "Ensure response headers are immutable");

test(function() {
const headers = Response.error().headers;

Expand Down

0 comments on commit 3c981a6

Please sign in to comment.