1
0
Fork 0
peertube/server/tests/shared/playlists.ts

23 lines
543 B
TypeScript
Raw Normal View History

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