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

Function test

test/parallel/test-fs-readfile-eof.js:29–41  ·  view source on GitHub ↗
(child)

Source from the content-addressed store, hash-verified

27const exec = require('child_process').exec;
28
29function test(child) {
30 exec(...common.escapePOSIXShell`(echo "${data1}"; sleep 0.5; echo "${data2}") | "${process.execPath}" "${__filename}" "${child}"`,
31 common.mustSucceed((stdout, stderr) => {
32 assert.strictEqual(
33 stdout,
34 expected,
35 `expected to read(${child === childType[0] ? 'with' : 'without'} encoding): '${expected}' but got: '${stdout}'`);
36 assert.strictEqual(
37 stderr,
38 '',
39 `expected not to read anything from stderr but got: '${stderr}'`);
40 }));
41}
42
43test(childType[0]);
44test(childType[1]);

Callers 1

Calls 1

execFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…