close all pages to avoid EPERM error on Windows 10 (#830)

This commit is contained in:
Alex Dehe Ng
2022-02-08 09:07:18 -06:00
committed by GitHub
parent d192b405ea
commit 69acc73136

View File

@@ -139,6 +139,8 @@ function getCode() {
});
emitter.once('done', async (shouldReplay) => {
const pages = await browser.pages();
await Promise.all(pages.map((page) => page.close()));
await browser.close();
if (shouldReplay) {
await replay(url, shouldReplay === 'replayWithFakeURL');