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 330d560
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/node/BrowserRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,10 @@ 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;
}
if ((error as NodeJS.ErrnoException).code === 'ESRCH') {
return false;
}

throw error;
}
}

0 comments on commit 330d560

Please sign in to comment.