MCPcopy Index your code
hub / github.com/ThatGuySam/doesitarm / stopChildProcess

Function stopChildProcess

test/playwright/support/astro-browser-test.ts:148–169  ·  view source on GitHub ↗
( childProcess: ChildProcessWithoutNullStreams | null )

Source from the content-addressed store, hash-verified

146}
147
148export function stopChildProcess ( childProcess: ChildProcessWithoutNullStreams | null ) {
149 return new Promise<void>( resolve => {
150 if ( !childProcess ) {
151 resolve()
152 return
153 }
154
155 if ( childProcess.killed || childProcess.exitCode !== null ) {
156 resolve()
157 return
158 }
159
160 childProcess.once( 'exit', () => resolve() )
161 childProcess.kill( 'SIGTERM' )
162
163 setTimeout( () => {
164 if ( childProcess.exitCode === null ) {
165 childProcess.kill( 'SIGKILL' )
166 }
167 }, 5 * 1000 ).unref()
168 } )
169}
170
171export async function launchBrowser (): Promise<Browser> {
172 return chromium.launch({

Calls

no outgoing calls

Tested by

no test coverage detected