/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
import { expect } from 'chai'
import { HttpStatusCode } from '@shared/models'
import {
let validId2: string
before(async function () {
+ this.timeout(360_000)
+
{
const { uuid } = await servers[0].videos.quickUpload({ name: 'video 1' })
validId1 = uuid
let hlsId: string
before(async function () {
+ this.timeout(120_000)
+
{
const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' })
webtorrentId = uuid
})
it('Shoulde delete a webtorrent file', async function () {
+ this.timeout(30_000)
+
const video = await servers[0].videos.get({ id: webtorrentId })
const files = video.files
})
it('Should delete all webtorrent files', async function () {
+ this.timeout(30_000)
+
const video = await servers[0].videos.get({ id: webtorrentId })
const files = video.files
})
it('Should delete a hls file', async function () {
+ this.timeout(30_000)
+
const video = await servers[0].videos.get({ id: hlsId })
const files = video.streamingPlaylists[0].files
const toDelete = files[0]
expect(video.streamingPlaylists[0].files).to.have.lengthOf(files.length - 1)
expect(video.streamingPlaylists[0].files.find(f => f.id === toDelete.id)).to.not.exist
- const { text } = await makeRawRequest(video.streamingPlaylists[0].playlistUrl)
+ const { text } = await makeRawRequest({ url: video.streamingPlaylists[0].playlistUrl, expectedStatus: HttpStatusCode.OK_200 })
expect(text.includes(`-${toDelete.resolution.id}.m3u8`)).to.be.false
expect(text.includes(`-${video.streamingPlaylists[0].files[0].resolution.id}.m3u8`)).to.be.true
})
it('Should delete all hls files', async function () {
+ this.timeout(30_000)
+
const video = await servers[0].videos.get({ id: hlsId })
const files = video.streamingPlaylists[0].files
})
it('Should not delete last file of a video', async function () {
+ this.timeout(60_000)
+
const webtorrentOnly = await servers[0].videos.get({ id: hlsId })
const hlsOnly = await servers[0].videos.get({ id: webtorrentId })