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

Function test

test/parallel/test-runner-import-no-scheme.js:41–50  ·  view source on GitHub ↗
(argv, expectedToFail = false)

Source from the content-addressed store, hash-verified

39fs.writeFileSync(reportersIndexFile, 'module.exports = { marker: 1 };');
40
41function test(argv, expectedToFail = false) {
42 const child = spawnSync(process.execPath, argv, { cwd: tmpdir.path });
43 if (expectedToFail) {
44 assert.strictEqual(child.status, 1);
45 assert.strictEqual(child.stdout.toString().trim(), '');
46 } else {
47 assert.strictEqual(child.status, 0);
48 assert.strictEqual(child.stdout.toString().trim(), '{ marker: 1 }');
49 }
50}
51
52test(['-e', 'console.log(require("test"))']);
53test(['-e', 'console.log(require("test/reporters"))']);

Callers 1

Calls 2

spawnSyncFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…