MCPcopy
hub / github.com/microsoft/playwright / run

Function run

tests/components/test-all.spec.js:37–54  ·  view source on GitHub ↗
(command, args, folder)

Source from the content-addressed store, hash-verified

35});
36
37async function run(command, args, folder) {
38 const child = spawn(command, args, {
39 cwd: folder,
40 stdio: 'pipe',
41 env: process.env,
42 shell: true,
43 // On non-windows platforms, `detached: true` makes child process a leader of a new
44 // process group, making it possible to kill child process tree with `.kill(-pid)` command.
45 // @see https://nodejs.org/api/child_process.html#child_process_options_detached
46 detached: !isWindows,
47 });
48 activeChild = child;
49 child.stdout.on('data', data => process.stdout.write(data));
50 child.stderr.on('data', data => process.stdout.write(data));
51 process.on('exit', onExit);
52 const code = await new Promise(f => child.on('close', f));
53 expect(code).toEqual(0);
54}
55
56function onExit() {
57 if (activeChild) {

Calls 3

onMethod · 0.65
writeMethod · 0.65
toEqualMethod · 0.65

Tested by

no test coverage detected