1
0
Fork 0
peertube/server/tests/shared/playlists.ts
2021-12-17 12:24:03 +01:00

25 lines
621 B
TypeScript

import { expect } from 'chai'
import { readdir } from 'fs-extra'
import { join } from 'path'
import { root } from '@shared/core-utils'
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
}