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

Function test

test/parallel/test-http-status-message.js:36–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34s.listen(0, test);
35
36function test() {
37 const bufs = [];
38 const client = net.connect(
39 this.address().port,
40 function() {
41 client.write(
42 'GET / HTTP/1.1\r\n' +
43 'Host: example.com\r\n' +
44 'Connection: close\r\n\r\n');
45 }
46 );
47 client.on('data', function(chunk) {
48 bufs.push(chunk);
49 });
50 client.on('end', common.mustCall(() => {
51 const head = Buffer.concat(bufs)
52 .toString('latin1')
53 .split('\r\n')[0];
54 assert.strictEqual(head, 'HTTP/1.1 200 Custom Message');
55 console.log('ok');
56 s.close();
57 }));
58}

Callers

nothing calls this directly

Calls 10

concatMethod · 0.80
connectMethod · 0.65
addressMethod · 0.65
closeMethod · 0.65
writeMethod · 0.45
onMethod · 0.45
pushMethod · 0.45
splitMethod · 0.45
toStringMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…