Skip to content

Commit

Permalink
✅ Clean up browser process for repeated testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wwilsman committed Feb 14, 2021
1 parent 0968fff commit ea74681
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/core/src/discovery/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ export default class Browser extends EventEmitter {
});
}));
}

// cleanup process listeners for garbage collection during testing
/* istanbul ignore else: sanity */
if (this.process) {
this.process.removeAllListeners();
this.process.stderr.removeAllListeners();
this.process.stdout.removeAllListeners();
this.process.stderr.close();
this.process.stdout.close();
delete this.process;
}
}

async page({ meta }) {
Expand Down

0 comments on commit ea74681

Please sign in to comment.