PeerTube/server/tests/shared/video-playlists.ts

23 lines
543 B
TypeScript
Raw Normal View History

2021-07-08 15:54:39 +02:00
import { expect } from 'chai'
import { readdir } from 'fs-extra'
import { PeerTubeServer } from '@shared/server-commands'
2021-07-08 15:54:39 +02:00
async function checkPlaylistFilesWereRemoved (
playlistUUID: string,
server: PeerTubeServer,
2021-07-08 15:54:39 +02:00
directories = [ 'thumbnails' ]
) {
for (const directory of directories) {
const directoryPath = server.getDirectoryPath(directory)
2021-07-08 15:54:39 +02:00
const files = await readdir(directoryPath)
for (const file of files) {
expect(file).to.not.contain(playlistUUID)
}
}
}
export {
checkPlaylistFilesWereRemoved
}