MCPcopy
hub / github.com/microsoft/vscode-js-debug / setupCRA

Function setupCRA

src/test/framework/reactTest.ts:85–101  ·  view source on GitHub ↗
(projectName: string, cwd: string, args: string[] = [])

Source from the content-addressed store, hash-verified

83});
84
85async function setupCRA(projectName: string, cwd: string, args: string[] = []): Promise<void> {
86 console.log('Setting up CRA in ' + cwd);
87 fs.mkdirSync(cwd, { recursive: true });
88 const setupProc = cp.spawn('npx', ['create-react-app', ...args, projectName], {
89 cwd,
90 stdio: 'pipe',
91 env: process.env,
92 });
93 setupProc.stdout.on('data', d => console.log(d.toString().replace(/\r?\n$/, '')));
94 setupProc.stderr.on('data', d => console.error(d.toString().replace(/\r?\n$/, '')));
95
96 const done = getDeferred();
97 setupProc.once('exit', () => {
98 done.resolve(undefined);
99 });
100 await done.promise;
101}
102
103async function startDevServer(projectFolder: string): Promise<cp.ChildProcessWithoutNullStreams> {
104 const devServerListening = getDeferred();

Callers 1

reactTest.tsFile · 0.85

Calls 9

getDeferredFunction · 0.90
resolveMethod · 0.80
logMethod · 0.65
spawnMethod · 0.65
onMethod · 0.65
replaceMethod · 0.65
errorMethod · 0.65
onceMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected