]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/shared/video-playlists.ts
8db303fd86f1f558b3ecd101ac72796558b29aaa
[github/Chocobozzz/PeerTube.git] / server / tests / shared / video-playlists.ts
1 import { expect } from 'chai'
2 import { readdir } from 'fs-extra'
3 import { PeerTubeServer } from '@shared/server-commands'
4
5 async function checkPlaylistFilesWereRemoved (
6 playlistUUID: string,
7 server: PeerTubeServer,
8 directories = [ 'thumbnails' ]
9 ) {
10 for (const directory of directories) {
11 const directoryPath = server.getDirectoryPath(directory)
12
13 const files = await readdir(directoryPath)
14 for (const file of files) {
15 expect(file).to.not.contain(playlistUUID)
16 }
17 }
18 }
19
20 export {
21 checkPlaylistFilesWereRemoved
22 }