aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 15:44:32 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 15:47:54 +0200
commit863477173efa82a4412d2e522aa46462249f9199 (patch)
tree40f0ae28691780d79acef5ba4dbd2ef0694ce8ff /server/tests/api/videos
parente0faa8ad6e18ce6248ef1ec93a59dab5b05be468 (diff)
downloadPeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.gz
PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.zst
PeerTube-863477173efa82a4412d2e522aa46462249f9199.zip
Cleanup tests imports
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/multiple-servers.ts4
-rw-r--r--server/tests/api/videos/resumable-upload.ts4
-rw-r--r--server/tests/api/videos/single-server.ts4
-rw-r--r--server/tests/api/videos/video-captions.ts4
-rw-r--r--server/tests/api/videos/video-change-ownership.ts4
-rw-r--r--server/tests/api/videos/video-channels.ts4
-rw-r--r--server/tests/api/videos/video-comments.ts4
-rw-r--r--server/tests/api/videos/video-description.ts4
-rw-r--r--server/tests/api/videos/video-nsfw.ts4
-rw-r--r--server/tests/api/videos/video-playlist-thumbnails.ts4
-rw-r--r--server/tests/api/videos/video-playlists.ts4
-rw-r--r--server/tests/api/videos/video-privacy.ts4
-rw-r--r--server/tests/api/videos/video-schedule-update.ts4
-rw-r--r--server/tests/api/videos/video-source.ts4
-rw-r--r--server/tests/api/videos/videos-history.ts4
-rw-r--r--server/tests/api/videos/videos-overview.ts4
16 files changed, 16 insertions, 48 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 766cc8236..23790ba65 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import request from 'supertest' 4import request from 'supertest'
5import { 5import {
6 checkTmpIsEmpty, 6 checkTmpIsEmpty,
@@ -25,8 +25,6 @@ import {
25 webtorrentAdd 25 webtorrentAdd
26} from '@shared/server-commands' 26} from '@shared/server-commands'
27 27
28const expect = chai.expect
29
30describe('Test multiple servers', function () { 28describe('Test multiple servers', function () {
31 let servers: PeerTubeServer[] = [] 29 let servers: PeerTubeServer[] = []
32 const toRemove = [] 30 const toRemove = []
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts
index 9936d5467..0625828a1 100644
--- a/server/tests/api/videos/resumable-upload.ts
+++ b/server/tests/api/videos/resumable-upload.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { pathExists, readdir, stat } from 'fs-extra' 4import { pathExists, readdir, stat } from 'fs-extra'
5import { join } from 'path' 5import { join } from 'path'
6import { buildAbsoluteFixturePath } from '@shared/core-utils' 6import { buildAbsoluteFixturePath } from '@shared/core-utils'
@@ -8,8 +8,6 @@ import { sha1 } from '@shared/extra-utils'
8import { HttpStatusCode, VideoPrivacy } from '@shared/models' 8import { HttpStatusCode, VideoPrivacy } from '@shared/models'
9import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' 9import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands'
10 10
11const expect = chai.expect
12
13// Most classic resumable upload tests are done in other test suites 11// Most classic resumable upload tests are done in other test suites
14 12
15describe('Test resumable upload', function () { 13describe('Test resumable upload', function () {
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts
index 574fb523e..da8bde07b 100644
--- a/server/tests/api/videos/single-server.ts
+++ b/server/tests/api/videos/single-server.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { checkVideoFilesWereRemoved, completeVideoCheck, testImage } from '@server/tests/shared' 4import { checkVideoFilesWereRemoved, completeVideoCheck, testImage } from '@server/tests/shared'
5import { wait } from '@shared/core-utils' 5import { wait } from '@shared/core-utils'
6import { Video, VideoPrivacy } from '@shared/models' 6import { Video, VideoPrivacy } from '@shared/models'
@@ -14,8 +14,6 @@ import {
14 waitJobs 14 waitJobs
15} from '@shared/server-commands' 15} from '@shared/server-commands'
16 16
17const expect = chai.expect
18
19describe('Test a single server', function () { 17describe('Test a single server', function () {
20 18
21 function runSuite (mode: 'legacy' | 'resumable') { 19 function runSuite (mode: 'legacy' | 'resumable') {
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts
index b68e5e6e8..0630c9d3a 100644
--- a/server/tests/api/videos/video-captions.ts
+++ b/server/tests/api/videos/video-captions.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { checkVideoFilesWereRemoved, testCaptionFile } from '@server/tests/shared' 4import { checkVideoFilesWereRemoved, testCaptionFile } from '@server/tests/shared'
5import { wait } from '@shared/core-utils' 5import { wait } from '@shared/core-utils'
6import { 6import {
@@ -12,8 +12,6 @@ import {
12 waitJobs 12 waitJobs
13} from '@shared/server-commands' 13} from '@shared/server-commands'
14 14
15const expect = chai.expect
16
17describe('Test video captions', function () { 15describe('Test video captions', function () {
18 const uuidRegex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' 16 const uuidRegex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
19 17
diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts
index 85bc191b6..e9ef67493 100644
--- a/server/tests/api/videos/video-change-ownership.ts
+++ b/server/tests/api/videos/video-change-ownership.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { 4import {
5 ChangeOwnershipCommand, 5 ChangeOwnershipCommand,
6 cleanupTests, 6 cleanupTests,
@@ -14,8 +14,6 @@ import {
14} from '@shared/server-commands' 14} from '@shared/server-commands'
15import { HttpStatusCode, VideoPrivacy } from '@shared/models' 15import { HttpStatusCode, VideoPrivacy } from '@shared/models'
16 16
17const expect = chai.expect
18
19describe('Test video change ownership - nominal', function () { 17describe('Test video change ownership - nominal', function () {
20 let servers: PeerTubeServer[] = [] 18 let servers: PeerTubeServer[] = []
21 19
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index b7645ea59..86a8a038c 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { basename } from 'path' 4import { basename } from 'path'
5import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' 5import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants'
6import { testFileExistsOrNot, testImage } from '@server/tests/shared' 6import { testFileExistsOrNot, testImage } from '@server/tests/shared'
@@ -17,8 +17,6 @@ import {
17 waitJobs 17 waitJobs
18} from '@shared/server-commands' 18} from '@shared/server-commands'
19 19
20const expect = chai.expect
21
22async function findChannel (server: PeerTubeServer, channelId: number) { 20async function findChannel (server: PeerTubeServer, channelId: number) {
23 const body = await server.channels.list({ sort: '-name' }) 21 const body = await server.channels.list({ sort: '-name' })
24 22
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts
index 6d74a865f..348b408e8 100644
--- a/server/tests/api/videos/video-comments.ts
+++ b/server/tests/api/videos/video-comments.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { dateIsValid, testImage } from '@server/tests/shared' 4import { dateIsValid, testImage } from '@server/tests/shared'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
@@ -12,8 +12,6 @@ import {
12 setDefaultChannelAvatar 12 setDefaultChannelAvatar
13} from '@shared/server-commands' 13} from '@shared/server-commands'
14 14
15const expect = chai.expect
16
17describe('Test video comments', function () { 15describe('Test video comments', function () {
18 let server: PeerTubeServer 16 let server: PeerTubeServer
19 let videoId: number 17 let videoId: number
diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts
index 347325741..a74b78a5f 100644
--- a/server/tests/api/videos/video-description.ts
+++ b/server/tests/api/videos/video-description.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { 4import {
5 cleanupTests, 5 cleanupTests,
6 createMultipleServers, 6 createMultipleServers,
@@ -10,8 +10,6 @@ import {
10 waitJobs 10 waitJobs
11} from '@shared/server-commands' 11} from '@shared/server-commands'
12 12
13const expect = chai.expect
14
15describe('Test video description', function () { 13describe('Test video description', function () {
16 let servers: PeerTubeServer[] = [] 14 let servers: PeerTubeServer[] = []
17 let videoUUID = '' 15 let videoUUID = ''
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts
index cfa130043..65e9c8730 100644
--- a/server/tests/api/videos/video-nsfw.ts
+++ b/server/tests/api/videos/video-nsfw.ts
@@ -1,11 +1,9 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' 4import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
5import { BooleanBothQuery, CustomConfig, ResultList, Video, VideosOverview } from '@shared/models' 5import { BooleanBothQuery, CustomConfig, ResultList, Video, VideosOverview } from '@shared/models'
6 6
7const expect = chai.expect
8
9function createOverviewRes (overview: VideosOverview) { 7function createOverviewRes (overview: VideosOverview) {
10 const videos = overview.categories[0].videos 8 const videos = overview.categories[0].videos
11 return { data: videos, total: videos.length } 9 return { data: videos, total: videos.length }
diff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.ts
index 019f34b6b..356939b93 100644
--- a/server/tests/api/videos/video-playlist-thumbnails.ts
+++ b/server/tests/api/videos/video-playlist-thumbnails.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { testImage } from '@server/tests/shared' 4import { testImage } from '@server/tests/shared'
5import { VideoPlaylistPrivacy } from '@shared/models' 5import { VideoPlaylistPrivacy } from '@shared/models'
6import { 6import {
@@ -13,8 +13,6 @@ import {
13 waitJobs 13 waitJobs
14} from '@shared/server-commands' 14} from '@shared/server-commands'
15 15
16const expect = chai.expect
17
18describe('Playlist thumbnail', function () { 16describe('Playlist thumbnail', function () {
19 let servers: PeerTubeServer[] = [] 17 let servers: PeerTubeServer[] = []
20 18
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
index dd5f6a3ca..47b8c7b1e 100644
--- a/server/tests/api/videos/video-playlists.ts
+++ b/server/tests/api/videos/video-playlists.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { checkPlaylistFilesWereRemoved, testImage } from '@server/tests/shared' 4import { checkPlaylistFilesWereRemoved, testImage } from '@server/tests/shared'
5import { wait } from '@shared/core-utils' 5import { wait } from '@shared/core-utils'
6import { 6import {
@@ -24,8 +24,6 @@ import {
24 waitJobs 24 waitJobs
25} from '@shared/server-commands' 25} from '@shared/server-commands'
26 26
27const expect = chai.expect
28
29async function checkPlaylistElementType ( 27async function checkPlaylistElementType (
30 servers: PeerTubeServer[], 28 servers: PeerTubeServer[],
31 playlistId: string, 29 playlistId: string,
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index 711622df9..b18c71c94 100644
--- a/server/tests/api/videos/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -1,12 +1,10 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { wait } from '@shared/core-utils' 4import { wait } from '@shared/core-utils'
5import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' 5import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
6import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' 6import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
7 7
8const expect = chai.expect
9
10describe('Test video privacy', function () { 8describe('Test video privacy', function () {
11 const servers: PeerTubeServer[] = [] 9 const servers: PeerTubeServer[] = []
12 let anotherUserToken: string 10 let anotherUserToken: string
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts
index 7865b3439..73f1519d9 100644
--- a/server/tests/api/videos/video-schedule-update.ts
+++ b/server/tests/api/videos/video-schedule-update.ts
@@ -1,6 +1,6 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { wait } from '@shared/core-utils' 4import { wait } from '@shared/core-utils'
5import { VideoPrivacy } from '@shared/models' 5import { VideoPrivacy } from '@shared/models'
6import { 6import {
@@ -12,8 +12,6 @@ import {
12 waitJobs 12 waitJobs
13} from '@shared/server-commands' 13} from '@shared/server-commands'
14 14
15const expect = chai.expect
16
17function in10Seconds () { 15function in10Seconds () {
18 const now = new Date() 16 const now = new Date()
19 now.setSeconds(now.getSeconds() + 10) 17 now.setSeconds(now.getSeconds() + 10)
diff --git a/server/tests/api/videos/video-source.ts b/server/tests/api/videos/video-source.ts
index 4c1641ed0..5ecf8316f 100644
--- a/server/tests/api/videos/video-source.ts
+++ b/server/tests/api/videos/video-source.ts
@@ -1,8 +1,6 @@
1import * as chai from 'chai' 1import { expect } from 'chai'
2import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' 2import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
3 3
4const expect = chai.expect
5
6describe('Test video source', () => { 4describe('Test video source', () => {
7 let server: PeerTubeServer = null 5 let server: PeerTubeServer = null
8 const fixture = 'video_short.webm' 6 const fixture = 'video_short.webm'
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts
index 500744e40..6df26ab7d 100644
--- a/server/tests/api/videos/videos-history.ts
+++ b/server/tests/api/videos/videos-history.ts
@@ -1,12 +1,10 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { wait } from '@shared/core-utils' 4import { wait } from '@shared/core-utils'
5import { Video } from '@shared/models' 5import { Video } from '@shared/models'
6import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' 6import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
7 7
8const expect = chai.expect
9
10describe('Test videos history', function () { 8describe('Test videos history', function () {
11 let server: PeerTubeServer = null 9 let server: PeerTubeServer = null
12 let video1Id: number 10 let video1Id: number
diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts
index 5159e8248..c012d47c3 100644
--- a/server/tests/api/videos/videos-overview.ts
+++ b/server/tests/api/videos/videos-overview.ts
@@ -1,12 +1,10 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import { expect } from 'chai'
4import { wait } from '@shared/core-utils' 4import { wait } from '@shared/core-utils'
5import { VideosOverview } from '@shared/models' 5import { VideosOverview } from '@shared/models'
6import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' 6import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
7 7
8const expect = chai.expect
9
10describe('Test a videos overview', function () { 8describe('Test a videos overview', function () {
11 let server: PeerTubeServer = null 9 let server: PeerTubeServer = null
12 10