mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 14:16:16 -08:00
test: extend e2e tests
This commit is contained in:
1 parent
a64442a216
commit
6ef7f849bb
3 files changed
+117
-10
No files matched your search
+12
-10
@@ -76,20 +76,22 @@ test.describe('Upload playlists', () => {
|
||||
);
|
||||
await expect(page.getByTestId('channel-item')).toHaveCount(4);
|
||||
});
|
||||
});
|
||||
|
||||
test.afterEach(() => {
|
||||
deleteDbFile();
|
||||
});
|
||||
test.afterAll(async () => {
|
||||
deleteDbFile();
|
||||
await page.close();
|
||||
await app.close();
|
||||
});
|
||||
|
||||
function deleteDbFile() {
|
||||
const pathToFile = './e2e/db/data.db';
|
||||
|
||||
fs.unlink(pathToFile, function (err) {
|
||||
if (err) {
|
||||
throw err;
|
||||
} else {
|
||||
console.log('Successfully deleted the file.');
|
||||
}
|
||||
});
|
||||
try {
|
||||
fs.unlink(pathToFile, () => {
|
||||
console.log('db file was deleted');
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('db file not found');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user