1 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
4 import { expect } from 'chai'
10 setAccessTokensToServers,
12 } from '@shared/server-commands'
14 describe('Test videos files', function () {
15 let servers: PeerTubeServer[]
19 // ---------------------------------------------------------------
21 before(async function () {
24 servers = await createMultipleServers(2)
25 await setAccessTokensToServers(servers)
27 await doubleFollow(servers[0], servers[1])
29 await servers[0].config.enableTranscoding(true, true)
32 const { uuid } = await servers[0].videos.quickUpload({ name: 'video 1' })
37 const { uuid } = await servers[0].videos.quickUpload({ name: 'video 2' })
41 await waitJobs(servers)
44 it('Should delete webtorrent files', async function () {
47 await servers[0].videos.removeWebTorrentFiles({ videoId: validId1 })
49 await waitJobs(servers)
51 for (const server of servers) {
52 const video = await server.videos.get({ id: validId1 })
54 expect(video.files).to.have.lengthOf(0)
55 expect(video.streamingPlaylists).to.have.lengthOf(1)
59 it('Should delete HLS files', async function () {
62 await servers[0].videos.removeHLSFiles({ videoId: validId2 })
64 await waitJobs(servers)
66 for (const server of servers) {
67 const video = await server.videos.get({ id: validId2 })
69 expect(video.files).to.have.length.above(0)
70 expect(video.streamingPlaylists).to.have.lengthOf(0)
74 after(async function () {
75 await cleanupTests(servers)