MCPcopy Create free account
hub / github.com/angular/angular / spawn

Function spawn

vscode-ng-language-service/syntaxes/test/driver.ts:28–37  ·  view source on GitHub ↗

Wraps node's spawn in a Promise.

(...args: Parameters<typeof cp.spawn>)

Source from the content-addressed store, hash-verified

26
27/** Wraps node's spawn in a Promise. */
28function spawn(...args: Parameters<typeof cp.spawn>): Promise<number> {
29 const child = cp.spawn(...args);
30
31 return new Promise((resolve, reject) => {
32 child.on('exit', (code: number) => {
33 if (code === 0) resolve(0);
34 else reject(code);
35 });
36 });
37}
38
39async function snapshotTest({scopeName, grammarFiles, testFile}: TestCase): Promise<number> {
40 grammarFiles.push(...DUMMY_GRAMMARS);

Callers 1

snapshotTestFunction · 0.85

Calls 4

rejectFunction · 0.85
resolveFunction · 0.50
spawnMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected