MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-http-response-statuscode.js:10–18  ·  view source on GitHub ↗
(res, header, code)

Source from the content-addressed store, hash-verified

8let reqNum = 0;
9
10function test(res, header, code) {
11 assert.throws(() => {
12 res.writeHead(header);
13 }, {
14 code: 'ERR_HTTP_INVALID_STATUS_CODE',
15 name: 'RangeError',
16 message: `Invalid status code: ${code}`
17 });
18}
19
20const server = http.Server(common.mustCall(function(req, res) {
21 switch (reqNum) {

Calls 1

writeHeadMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…