cherry-pick(release-1.120: do not fail when removing non-existent video (#7072)

Cherry-Pick #7060 SHA e4d93cd1f3

Fixes #7058

Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
This commit is contained in:
Andrey Lushnikov 2021-06-11 11:00:06 -07:00 committed by GitHub
parent 4c807b3e62
commit 9c07499f2e
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(); const video = page.video();
if (!video) if (!video)
return; return;
const videoPath = await video.path(); try {
await fs.promises.unlink(videoPath).catch(e => {}); const videoPath = await video.path();
await fs.promises.unlink(videoPath);
} catch (e) {
// Silent catch.
}
})); }));
} }
}, },