]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-files.ts
Merge branch 'release/5.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-files.ts
index 313f020e984eff51b9da6a262e415e26791c2e1f..8c913bf31a1f49ef35cf3c83c3e7a784ce908da3 100644 (file)
@@ -1,6 +1,5 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { expect } from 'chai'
 import { HttpStatusCode } from '@shared/models'
 import {
@@ -34,6 +33,8 @@ describe('Test videos files', function () {
     let validId2: string
 
     before(async function () {
+      this.timeout(360_000)
+
       {
         const { uuid } = await servers[0].videos.quickUpload({ name: 'video 1' })
         validId1 = uuid
@@ -83,6 +84,8 @@ describe('Test videos files', function () {
     let hlsId: string
 
     before(async function () {
+      this.timeout(120_000)
+
       {
         const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' })
         webtorrentId = uuid
@@ -97,6 +100,8 @@ describe('Test videos files', function () {
     })
 
     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
 
@@ -113,6 +118,8 @@ describe('Test videos files', function () {
     })
 
     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
 
@@ -130,6 +137,8 @@ describe('Test videos files', function () {
     })
 
     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]
@@ -144,7 +153,7 @@ describe('Test videos files', function () {
         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
@@ -152,6 +161,8 @@ describe('Test videos files', function () {
     })
 
     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
 
@@ -169,6 +180,8 @@ describe('Test videos files', function () {
     })
 
     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 })