Skip to content

Commit

Permalink
fix: remove instanceof Error check causing issues in Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmydief committed Jun 9, 2022
1 parent 465a7c4 commit fbd7dd1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/node/BrowserRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,11 @@ function waitForWSEndpoint(
function pidExists(pid: number): boolean {
try {
return process.kill(pid, 0);
} catch (error) {
if (error instanceof Error) {
const err = error as NodeJS.ErrnoException;
if (err.code && err.code === 'ESRCH') {
return false;
}
} catch (error: NodeJS.ErrnoException) {
if (err.code === 'ESRCH') {
return false;
}

throw error;
}
}

0 comments on commit fbd7dd1

Please sign in to comment.