aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/tests/shared/playlists.ts
blob: 8db303fd86f1f558b3ecd101ac72796558b29aaa (plain) (tree)
1
2
3
4
5
6
7
8
9

                                  
                                                        


                                              
                         

                                
                                        
                                                            










                                               
import { expect } from 'chai'
import { readdir } from 'fs-extra'
import { PeerTubeServer } from '@shared/server-commands'

async function checkPlaylistFilesWereRemoved (
  playlistUUID: string,
  server: PeerTubeServer,
  directories = [ 'thumbnails' ]
) {
  for (const directory of directories) {
    const directoryPath = server.getDirectoryPath(directory)

    const files = await readdir(directoryPath)
    for (const file of files) {
      expect(file).to.not.contain(playlistUUID)
    }
  }
}

export {
  checkPlaylistFilesWereRemoved
}