MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / runWithStdin

Function runWithStdin

test/runner/codeceptq_test.js:36–43  ·  view source on GitHub ↗
(args, html)

Source from the content-addressed store, hash-verified

34}
35
36const runWithStdin = (args, html) => {
37 try {
38 const stdout = execSync(`node ${runner} ${args}`, { input: html, encoding: 'utf8' })
39 return { stdout, code: 0, stderr: '' }
40 } catch (err) {
41 return { stdout: err.stdout?.toString() || '', stderr: err.stderr?.toString() || '', code: err.status }
42 }
43}
44
45// For long snippets, assert first 50 chars only.
46const head = matches => matches.map(m => ({ line: m.line, snippet: m.snippet.slice(0, 50) }))

Callers 1

codeceptq_test.jsFile · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected