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

Function executeRequest

test/parallel/test-http-chunk-problem.js:48–74  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

46let server;
47
48function executeRequest(cb) {
49 // The execPath might contain chars that should be escaped in a shell context.
50 // On non-Windows, we can pass the path via the env; `"` is not a valid char on
51 // Windows, so we can simply pass the path.
52 const node = `"${common.isWindows ? process.execPath : '$NODE'}"`;
53 const file = `"${common.isWindows ? __filename : '$FILE'}"`;
54 const env = common.isWindows ? process.env : { ...process.env, NODE: process.execPath, FILE: __filename };
55 cp.exec([node,
56 file,
57 'request',
58 server.address().port,
59 '|',
60 node,
61 file,
62 'shasum' ].join(' '),
63 { env },
64 common.mustCall((err, stdout, stderr) => {
65 if (stderr.trim() !== '') {
66 console.log(stderr);
67 }
68 assert.ifError(err);
69 assert.strictEqual(stdout.slice(0, 40),
70 '8c206a1a87599f532ce68675536f0b1546900d7a');
71 cb();
72 })
73 );
74}
75
76
77tmpdir.refresh();

Callers 1

Calls 6

cbFunction · 0.70
addressMethod · 0.65
sliceMethod · 0.65
execMethod · 0.45
joinMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…