1
0
Fork 0
peertube/shared/server-commands/videos/playlists.ts

26 lines
611 B
TypeScript
Raw Normal View History

2021-07-08 09:54:39 -04:00
import { expect } from 'chai'
import { readdir } from 'fs-extra'
import { join } from 'path'
2021-07-13 03:43:59 -04:00
import { root } from '../miscs'
2021-07-08 09:54:39 -04:00
async function checkPlaylistFilesWereRemoved (
playlistUUID: string,
internalServerNumber: number,
directories = [ 'thumbnails' ]
) {
const testDirectory = 'test' + internalServerNumber
for (const directory of directories) {
const directoryPath = join(root(), testDirectory, directory)
const files = await readdir(directoryPath)
for (const file of files) {
expect(file).to.not.contain(playlistUUID)
}
}
}
export {
checkPlaylistFilesWereRemoved
}