Skip to content

Commit ac54432

Browse files
authored
wpt: update response-static-error.any.js (nodejs#1789)
1 parent 345bf70 commit ac54432

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/wpt/tests/fetch/api/response/response-static-error.any.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ test(function() {
1111
assert_true(responseError.headers.entries().next().done, "Headers should be empty");
1212
}, "Check response returned by static method error()");
1313

14+
promise_test (async function() {
15+
let response = await fetch("../resources/data.json");
16+
17+
try {
18+
response.headers.append('name', 'value');
19+
} catch (e) {
20+
assert_equals(e.constructor.name, "TypeError");
21+
}
22+
23+
assert_not_equals(response.headers.get("name"), "value", "response headers should be immutable");
24+
}, "Ensure response headers are immutable");
25+
1426
test(function() {
1527
const headers = Response.error().headers;
1628

0 commit comments

Comments
 (0)