fix(video): do not fail when removing non-existent video (#7060)

This commit is contained in:
Pavel Feldman 2021-06-10 22:23:02 -07:00 committed by GitHub
parent f52290d4ea
commit e4d93cd1f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,8 +162,12 @@ export const test = _baseTest.extend<PlaywrightTestArgs & PlaywrightTestOptions,
const video = page.video();
if (!video)
return;
const videoPath = await video.path();
await fs.promises.unlink(videoPath).catch(e => {});
try {
const videoPath = await video.path();
await fs.promises.unlink(videoPath);
} catch (e) {
// Silent catch.
}
}));
}
},