aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/activitypub/cleaner.ts2
-rw-r--r--server/tests/api/activitypub/client.ts5
-rw-r--r--server/tests/api/activitypub/fetch.ts2
-rw-r--r--server/tests/api/activitypub/refresher.ts5
-rw-r--r--server/tests/api/check-params/abuses.ts5
-rw-r--r--server/tests/api/check-params/accounts.ts2
-rw-r--r--server/tests/api/check-params/config.ts3
-rw-r--r--server/tests/api/check-params/contact-form.ts2
-rw-r--r--server/tests/api/check-params/live.ts5
-rw-r--r--server/tests/api/check-params/plugins.ts3
-rw-r--r--server/tests/api/check-params/search.ts2
-rw-r--r--server/tests/api/check-params/services.ts3
-rw-r--r--server/tests/api/check-params/user-notifications.ts3
-rw-r--r--server/tests/api/check-params/users.ts3
-rw-r--r--server/tests/api/check-params/video-blacklist.ts5
-rw-r--r--server/tests/api/check-params/video-captions.ts3
-rw-r--r--server/tests/api/check-params/video-channels.ts3
-rw-r--r--server/tests/api/check-params/video-comments.ts3
-rw-r--r--server/tests/api/check-params/video-imports.ts3
-rw-r--r--server/tests/api/check-params/video-playlists.ts4
-rw-r--r--server/tests/api/check-params/videos-filter.ts3
-rw-r--r--server/tests/api/check-params/videos-history.ts2
-rw-r--r--server/tests/api/live/live-constraints.ts2
-rw-r--r--server/tests/api/live/live-permanent.ts2
-rw-r--r--server/tests/api/live/live-save-replay.ts5
-rw-r--r--server/tests/api/live/live-socket-messages.ts2
-rw-r--r--server/tests/api/live/live-views.ts2
-rw-r--r--server/tests/api/live/live.ts15
-rw-r--r--server/tests/api/moderation/blocklist-notification.ts2
-rw-r--r--server/tests/api/moderation/blocklist.ts2
-rw-r--r--server/tests/api/notifications/admin-notifications.ts2
-rw-r--r--server/tests/api/notifications/comments-notifications.ts2
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts2
-rw-r--r--server/tests/api/notifications/notifications-api.ts2
-rw-r--r--server/tests/api/redundancy/manage-redundancy.ts4
-rw-r--r--server/tests/api/redundancy/redundancy-constraints.ts9
-rw-r--r--server/tests/api/redundancy/redundancy.ts7
-rw-r--r--server/tests/api/search/search-activitypub-video-channels.ts2
-rw-r--r--server/tests/api/search/search-activitypub-video-playlists.ts2
-rw-r--r--server/tests/api/search/search-activitypub-videos.ts2
-rw-r--r--server/tests/api/search/search-channels.ts2
-rw-r--r--server/tests/api/search/search-index.ts2
-rw-r--r--server/tests/api/search/search-playlists.ts2
-rw-r--r--server/tests/api/search/search-videos.ts2
-rw-r--r--server/tests/api/server/bulk.ts2
-rw-r--r--server/tests/api/server/config.ts3
-rw-r--r--server/tests/api/server/contact-form.ts2
-rw-r--r--server/tests/api/server/email.ts2
-rw-r--r--server/tests/api/server/follow-constraints.ts13
-rw-r--r--server/tests/api/server/follows.ts2
-rw-r--r--server/tests/api/server/handle-down.ts3
-rw-r--r--server/tests/api/server/homepage.ts2
-rw-r--r--server/tests/api/server/jobs.ts2
-rw-r--r--server/tests/api/server/plugins.ts5
-rw-r--r--server/tests/api/server/reverse-proxy.ts2
-rw-r--r--server/tests/api/server/stats.ts2
-rw-r--r--server/tests/api/users/user-subscriptions.ts5
-rw-r--r--server/tests/api/users/users-multiple-servers.ts2
-rw-r--r--server/tests/api/users/users-verification.ts2
-rw-r--r--server/tests/api/users/users.ts3
-rw-r--r--server/tests/api/videos/audio-only.ts2
-rw-r--r--server/tests/api/videos/multiple-servers.ts5
-rw-r--r--server/tests/api/videos/resumable-upload.ts3
-rw-r--r--server/tests/api/videos/video-captions.ts2
-rw-r--r--server/tests/api/videos/video-change-ownership.ts5
-rw-r--r--server/tests/api/videos/video-channels.ts2
-rw-r--r--server/tests/api/videos/video-comments.ts2
-rw-r--r--server/tests/api/videos/video-description.ts2
-rw-r--r--server/tests/api/videos/video-hls.ts5
-rw-r--r--server/tests/api/videos/video-nsfw.ts9
-rw-r--r--server/tests/api/videos/video-playlist-thumbnails.ts2
-rw-r--r--server/tests/api/videos/video-playlists.ts6
-rw-r--r--server/tests/api/videos/video-privacy.ts7
-rw-r--r--server/tests/api/videos/video-schedule-update.ts2
-rw-r--r--server/tests/api/videos/video-transcoder.ts5
-rw-r--r--server/tests/api/videos/videos-filter.ts5
-rw-r--r--server/tests/api/videos/videos-history.ts3
-rw-r--r--server/tests/api/videos/videos-views-cleaner.ts2
-rw-r--r--server/tests/cli/create-import-video-file-job.ts2
-rw-r--r--server/tests/cli/create-transcoding-job.ts2
-rw-r--r--server/tests/cli/optimize-old-videos.ts2
-rw-r--r--server/tests/cli/plugins.ts2
-rw-r--r--server/tests/cli/prune-storage.ts5
-rw-r--r--server/tests/cli/regenerate-thumbnails.ts5
-rw-r--r--server/tests/client.ts5
-rw-r--r--server/tests/external-plugins/auth-ldap.ts2
-rw-r--r--server/tests/external-plugins/auto-block-videos.ts2
-rw-r--r--server/tests/external-plugins/auto-mute.ts4
-rw-r--r--server/tests/feeds/feeds.ts5
-rw-r--r--server/tests/helpers/comment-model.ts2
-rw-r--r--server/tests/helpers/core-utils.ts4
-rw-r--r--server/tests/helpers/image.ts2
-rw-r--r--server/tests/misc-endpoints.ts3
-rw-r--r--server/tests/plugins/action-hooks.ts2
-rw-r--r--server/tests/plugins/external-auth.ts7
-rw-r--r--server/tests/plugins/filter-hooks.ts3
-rw-r--r--server/tests/plugins/html-injection.ts2
-rw-r--r--server/tests/plugins/id-and-pass-auth.ts5
-rw-r--r--server/tests/plugins/plugin-helpers.ts6
-rw-r--r--server/tests/plugins/plugin-router.ts4
-rw-r--r--server/tests/plugins/plugin-storage.ts2
-rw-r--r--server/tests/plugins/plugin-transcoding.ts2
-rw-r--r--server/tests/plugins/plugin-unloading.ts2
-rw-r--r--server/tests/plugins/video-constants.ts5
104 files changed, 158 insertions, 195 deletions
diff --git a/server/tests/api/activitypub/cleaner.ts b/server/tests/api/activitypub/cleaner.ts
index a5ce449f3..51cf6e599 100644
--- a/server/tests/api/activitypub/cleaner.ts
+++ b/server/tests/api/activitypub/cleaner.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts
index 53cc40663..c3e4b7f74 100644
--- a/server/tests/api/activitypub/client.ts
+++ b/server/tests/api/activitypub/client.ts
@@ -2,17 +2,16 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
10 makeActivityPubGetRequest, 9 makeActivityPubGetRequest,
11 PeerTubeServer, 10 PeerTubeServer,
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 setDefaultVideoChannel 12 setDefaultVideoChannel
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { VideoPlaylistPrivacy } from '@shared/models' 14import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
16 15
17const expect = chai.expect 16const expect = chai.expect
18 17
diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts
index ddfe6cfe0..422a75d6e 100644
--- a/server/tests/api/activitypub/fetch.ts
+++ b/server/tests/api/activitypub/fetch.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6 6
7const expect = chai.expect 7const expect = chai.expect
8 8
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts
index a0b72c7e6..81fee0044 100644
--- a/server/tests/api/activitypub/refresher.ts
+++ b/server/tests/api/activitypub/refresher.ts
@@ -1,11 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 cleanupTests, 5 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 6 createMultipleServers,
7 doubleFollow,
9 killallServers, 8 killallServers,
10 PeerTubeServer, 9 PeerTubeServer,
11 setAccessTokensToServers, 10 setAccessTokensToServers,
@@ -13,7 +12,7 @@ import {
13 wait, 12 wait,
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { VideoPlaylistPrivacy } from '@shared/models' 15import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
17 16
18describe('Test AP refresher', function () { 17describe('Test AP refresher', function () {
19 let servers: PeerTubeServer[] = [] 18 let servers: PeerTubeServer[] = []
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts
index 87d93195c..72f2cbd8f 100644
--- a/server/tests/api/check-params/abuses.ts
+++ b/server/tests/api/check-params/abuses.ts
@@ -1,22 +1,21 @@
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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 AbusesCommand, 5 AbusesCommand,
7 checkBadCountPagination, 6 checkBadCountPagination,
8 checkBadSortPagination, 7 checkBadSortPagination,
9 checkBadStartPagination, 8 checkBadStartPagination,
10 cleanupTests, 9 cleanupTests,
11 doubleFollow,
12 createSingleServer, 10 createSingleServer,
11 doubleFollow,
13 makeGetRequest, 12 makeGetRequest,
14 makePostBodyRequest, 13 makePostBodyRequest,
15 PeerTubeServer, 14 PeerTubeServer,
16 setAccessTokensToServers, 15 setAccessTokensToServers,
17 waitJobs 16 waitJobs
18} from '@shared/extra-utils' 17} from '@shared/extra-utils'
19import { AbuseCreate, AbuseState } from '@shared/models' 18import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
20 19
21describe('Test abuses API validators', function () { 20describe('Test abuses API validators', function () {
22 const basePath = '/api/v1/abuses/' 21 const basePath = '/api/v1/abuses/'
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index 0cae485d9..141d869b7 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 checkBadCountPagination, 5 checkBadCountPagination,
7 checkBadSortPagination, 6 checkBadSortPagination,
@@ -10,6 +9,7 @@ import {
10 createSingleServer, 9 createSingleServer,
11 PeerTubeServer 10 PeerTubeServer
12} from '@shared/extra-utils' 11} from '@shared/extra-utils'
12import { HttpStatusCode } from '@shared/models'
13 13
14describe('Test accounts API validators', function () { 14describe('Test accounts API validators', function () {
15 const path = '/api/v1/accounts/' 15 const path = '/api/v1/accounts/'
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts
index c3438917e..87cb2287e 100644
--- a/server/tests/api/check-params/config.ts
+++ b/server/tests/api/check-params/config.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -12,7 +11,7 @@ import {
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers 12 setAccessTokensToServers
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { CustomConfig } from '@shared/models' 14import { CustomConfig, HttpStatusCode } from '@shared/models'
16 15
17describe('Test config API validators', function () { 16describe('Test config API validators', function () {
18 const path = '/api/v1/config/custom' 17 const path = '/api/v1/config/custom'
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts
index 8e755c69b..1df9993da 100644
--- a/server/tests/api/check-params/contact-form.ts
+++ b/server/tests/api/check-params/contact-form.ts
@@ -1,9 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils' 4import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils'
6import { ContactFormCommand } from '@shared/extra-utils/server' 5import { ContactFormCommand } from '@shared/extra-utils/server'
6import { HttpStatusCode } from '@shared/models'
7 7
8describe('Test contact form API validators', function () { 8describe('Test contact form API validators', function () {
9 let server: PeerTubeServer 9 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts
index 0ef86a538..700b4724d 100644
--- a/server/tests/api/check-params/live.ts
+++ b/server/tests/api/check-params/live.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 buildAbsoluteFixturePath, 6 buildAbsoluteFixturePath,
8 cleanupTests, 7 cleanupTests,
@@ -10,12 +9,12 @@ import {
10 LiveCommand, 9 LiveCommand,
11 makePostBodyRequest, 10 makePostBodyRequest,
12 makeUploadRequest, 11 makeUploadRequest,
13 sendRTMPStream,
14 PeerTubeServer, 12 PeerTubeServer,
13 sendRTMPStream,
15 setAccessTokensToServers, 14 setAccessTokensToServers,
16 stopFfmpeg 15 stopFfmpeg
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
18import { VideoCreateResult, VideoPrivacy } from '@shared/models' 17import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
19 18
20describe('Test video lives API validator', function () { 19describe('Test video lives API validator', function () {
21 const path = '/api/v1/videos/live' 20 const path = '/api/v1/videos/live'
diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.ts
index d3dda7fce..33f84ecbc 100644
--- a/server/tests/api/check-params/plugins.ts
+++ b/server/tests/api/check-params/plugins.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 checkBadCountPagination, 5 checkBadCountPagination,
7 checkBadSortPagination, 6 checkBadSortPagination,
@@ -14,7 +13,7 @@ import {
14 PeerTubeServer, 13 PeerTubeServer,
15 setAccessTokensToServers 14 setAccessTokensToServers
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
17import { PeerTubePlugin, PluginType } from '@shared/models' 16import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models'
18 17
19describe('Test server plugins API validators', function () { 18describe('Test server plugins API validators', function () {
20 let server: PeerTubeServer 19 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts
index b49169e38..a3da54e1f 100644
--- a/server/tests/api/check-params/search.ts
+++ b/server/tests/api/check-params/search.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 checkBadCountPagination, 5 checkBadCountPagination,
7 checkBadSortPagination, 6 checkBadSortPagination,
@@ -12,6 +11,7 @@ import {
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers 12 setAccessTokensToServers
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
14import { HttpStatusCode } from '@shared/models'
15 15
16function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) { 16function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {
17 return server.config.updateCustomSubConfig({ 17 return server.config.updateCustomSubConfig({
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index 973b25598..4c4a5cade 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 cleanupTests, 5 cleanupTests,
7 createSingleServer, 6 createSingleServer,
@@ -10,7 +9,7 @@ import {
10 setAccessTokensToServers, 9 setAccessTokensToServers,
11 setDefaultVideoChannel 10 setDefaultVideoChannel
12} from '@shared/extra-utils' 11} from '@shared/extra-utils'
13import { VideoPlaylistPrivacy } from '@shared/models' 12import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
14 13
15describe('Test services API validators', function () { 14describe('Test services API validators', function () {
16 let server: PeerTubeServer 15 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index 3b709ee5a..17edf5aa1 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { io } from 'socket.io-client' 4import { io } from 'socket.io-client'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 checkBadCountPagination, 6 checkBadCountPagination,
8 checkBadSortPagination, 7 checkBadSortPagination,
@@ -16,7 +15,7 @@ import {
16 setAccessTokensToServers, 15 setAccessTokensToServers,
17 wait 16 wait
18} from '@shared/extra-utils' 17} from '@shared/extra-utils'
19import { UserNotificationSetting, UserNotificationSettingValue } from '@shared/models' 18import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
20 19
21describe('Test user notifications API validators', function () { 20describe('Test user notifications API validators', function () {
22 let server: PeerTubeServer 21 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index 34fe309f9..9d8f933db 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 buildAbsoluteFixturePath, 6 buildAbsoluteFixturePath,
8 checkBadCountPagination, 7 checkBadCountPagination,
@@ -20,7 +19,7 @@ import {
20 setAccessTokensToServers, 19 setAccessTokensToServers,
21 UsersCommand 20 UsersCommand
22} from '@shared/extra-utils' 21} from '@shared/extra-utils'
23import { UserAdminFlag, UserRole, VideoCreateResult } from '@shared/models' 22import { HttpStatusCode, UserAdminFlag, UserRole, VideoCreateResult } from '@shared/models'
24 23
25describe('Test users API validators', function () { 24describe('Test users API validators', function () {
26 const path = '/api/v1/users/' 25 const path = '/api/v1/users/'
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts
index 2072df4b6..d28c6a952 100644
--- a/server/tests/api/check-params/video-blacklist.ts
+++ b/server/tests/api/check-params/video-blacklist.ts
@@ -2,22 +2,21 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 BlacklistCommand, 6 BlacklistCommand,
8 checkBadCountPagination, 7 checkBadCountPagination,
9 checkBadSortPagination, 8 checkBadSortPagination,
10 checkBadStartPagination, 9 checkBadStartPagination,
11 cleanupTests, 10 cleanupTests,
12 doubleFollow,
13 createMultipleServers, 11 createMultipleServers,
12 doubleFollow,
14 makePostBodyRequest, 13 makePostBodyRequest,
15 makePutBodyRequest, 14 makePutBodyRequest,
16 PeerTubeServer, 15 PeerTubeServer,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 waitJobs 17 waitJobs
19} from '@shared/extra-utils' 18} from '@shared/extra-utils'
20import { VideoBlacklistType } from '@shared/models' 19import { HttpStatusCode, VideoBlacklistType } from '@shared/models'
21 20
22describe('Test video blacklist API validators', function () { 21describe('Test video blacklist API validators', function () {
23 let servers: PeerTubeServer[] 22 let servers: PeerTubeServer[]
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index 1b3d1aa95..5aaeb27fe 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 buildAbsoluteFixturePath, 5 buildAbsoluteFixturePath,
7 cleanupTests, 6 cleanupTests,
@@ -12,7 +11,7 @@ import {
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers 12 setAccessTokensToServers
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { VideoCreateResult } from '@shared/models' 14import { HttpStatusCode, VideoCreateResult } from '@shared/models'
16 15
17describe('Test video captions API validator', function () { 16describe('Test video captions API validator', function () {
18 const path = '/api/v1/videos/' 17 const path = '/api/v1/videos/'
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index bbe42e43d..2e63916d4 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -3,7 +3,6 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 buildAbsoluteFixturePath, 7 buildAbsoluteFixturePath,
9 ChannelsCommand, 8 ChannelsCommand,
@@ -19,7 +18,7 @@ import {
19 PeerTubeServer, 18 PeerTubeServer,
20 setAccessTokensToServers 19 setAccessTokensToServers
21} from '@shared/extra-utils' 20} from '@shared/extra-utils'
22import { VideoChannelUpdate } from '@shared/models' 21import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
23 22
24const expect = chai.expect 23const expect = chai.expect
25 24
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index bfd9e0172..2d9ee1e0d 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 checkBadCountPagination, 6 checkBadCountPagination,
8 checkBadSortPagination, 7 checkBadSortPagination,
@@ -15,7 +14,7 @@ import {
15 PeerTubeServer, 14 PeerTubeServer,
16 setAccessTokensToServers 15 setAccessTokensToServers
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
18import { VideoCreateResult } from '@shared/models' 17import { HttpStatusCode, VideoCreateResult } from '@shared/models'
19 18
20const expect = chai.expect 19const expect = chai.expect
21 20
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index 957556c9b..d6d745488 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 buildAbsoluteFixturePath, 6 buildAbsoluteFixturePath,
8 checkBadCountPagination, 7 checkBadCountPagination,
@@ -17,7 +16,7 @@ import {
17 PeerTubeServer, 16 PeerTubeServer,
18 setAccessTokensToServers 17 setAccessTokensToServers
19} from '@shared/extra-utils' 18} from '@shared/extra-utils'
20import { VideoPrivacy } from '@shared/models' 19import { HttpStatusCode, VideoPrivacy } from '@shared/models'
21 20
22describe('Test video imports API validator', function () { 21describe('Test video imports API validator', function () {
23 const path = '/api/v1/videos/imports' 22 const path = '/api/v1/videos/imports'
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts
index 7dcb4935a..e4d541b48 100644
--- a/server/tests/api/check-params/video-playlists.ts
+++ b/server/tests/api/check-params/video-playlists.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 checkBadCountPagination, 5 checkBadCountPagination,
7 checkBadSortPagination, 6 checkBadSortPagination,
@@ -9,12 +8,13 @@ import {
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
11 makeGetRequest, 10 makeGetRequest,
12 PlaylistsCommand,
13 PeerTubeServer, 11 PeerTubeServer,
12 PlaylistsCommand,
14 setAccessTokensToServers, 13 setAccessTokensToServers,
15 setDefaultVideoChannel 14 setDefaultVideoChannel
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
17import { 16import {
17 HttpStatusCode,
18 VideoPlaylistCreate, 18 VideoPlaylistCreate,
19 VideoPlaylistCreateResult, 19 VideoPlaylistCreateResult,
20 VideoPlaylistElementCreate, 20 VideoPlaylistElementCreate,
diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts
index c2c69904f..d08570bbe 100644
--- a/server/tests/api/check-params/videos-filter.ts
+++ b/server/tests/api/check-params/videos-filter.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 cleanupTests, 5 cleanupTests,
7 createSingleServer, 6 createSingleServer,
@@ -10,7 +9,7 @@ import {
10 setAccessTokensToServers, 9 setAccessTokensToServers,
11 setDefaultVideoChannel 10 setDefaultVideoChannel
12} from '@shared/extra-utils' 11} from '@shared/extra-utils'
13import { UserRole } from '@shared/models' 12import { HttpStatusCode, UserRole } from '@shared/models'
14 13
15async function testEndpoints (server: PeerTubeServer, token: string, filter: string, expectedStatus: HttpStatusCode) { 14async function testEndpoints (server: PeerTubeServer, token: string, filter: string, expectedStatus: HttpStatusCode) {
16 const paths = [ 15 const paths = [
diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.ts
index 7283a4d28..c3c309ed2 100644
--- a/server/tests/api/check-params/videos-history.ts
+++ b/server/tests/api/check-params/videos-history.ts
@@ -1,7 +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 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/models'
5import { 4import {
6 checkBadCountPagination, 5 checkBadCountPagination,
7 checkBadStartPagination, 6 checkBadStartPagination,
@@ -13,6 +12,7 @@ import {
13 PeerTubeServer, 12 PeerTubeServer,
14 setAccessTokensToServers 13 setAccessTokensToServers
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { HttpStatusCode } from '@shared/models'
16 16
17describe('Test videos history API validator', function () { 17describe('Test videos history API validator', function () {
18 const myHistoryPath = '/api/v1/users/me/history/videos' 18 const myHistoryPath = '/api/v1/users/me/history/videos'
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts
index a00833569..20346113d 100644
--- a/server/tests/api/live/live-constraints.ts
+++ b/server/tests/api/live/live-constraints.ts
@@ -7,8 +7,8 @@ import {
7 checkLiveCleanup, 7 checkLiveCleanup,
8 cleanupTests, 8 cleanupTests,
9 ConfigCommand, 9 ConfigCommand,
10 doubleFollow,
11 createMultipleServers, 10 createMultipleServers,
11 doubleFollow,
12 PeerTubeServer, 12 PeerTubeServer,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 setDefaultVideoChannel, 14 setDefaultVideoChannel,
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts
index 30d499e20..f07d4cfec 100644
--- a/server/tests/api/live/live-permanent.ts
+++ b/server/tests/api/live/live-permanent.ts
@@ -6,8 +6,8 @@ import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 ConfigCommand, 8 ConfigCommand,
9 doubleFollow,
10 createMultipleServers, 9 createMultipleServers,
10 doubleFollow,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultVideoChannel, 13 setDefaultVideoChannel,
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts
index 095c51b97..bd15396ec 100644
--- a/server/tests/api/live/live-save-replay.ts
+++ b/server/tests/api/live/live-save-replay.ts
@@ -3,13 +3,12 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { FfmpegCommand } from 'fluent-ffmpeg' 5import { FfmpegCommand } from 'fluent-ffmpeg'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 checkLiveCleanup, 7 checkLiveCleanup,
9 cleanupTests, 8 cleanupTests,
10 ConfigCommand, 9 ConfigCommand,
11 doubleFollow,
12 createMultipleServers, 10 createMultipleServers,
11 doubleFollow,
13 PeerTubeServer, 12 PeerTubeServer,
14 setAccessTokensToServers, 13 setAccessTokensToServers,
15 setDefaultVideoChannel, 14 setDefaultVideoChannel,
@@ -18,7 +17,7 @@ import {
18 wait, 17 wait,
19 waitJobs 18 waitJobs
20} from '@shared/extra-utils' 19} from '@shared/extra-utils'
21import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' 20import { HttpStatusCode, LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models'
22 21
23const expect = chai.expect 22const expect = chai.expect
24 23
diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts
index 3808964d1..2a1f9f108 100644
--- a/server/tests/api/live/live-socket-messages.ts
+++ b/server/tests/api/live/live-socket-messages.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { VideoPrivacy, VideoState } from '@shared/models' 5import { VideoPrivacy, VideoState } from '@shared/models'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 setDefaultVideoChannel, 12 setDefaultVideoChannel,
diff --git a/server/tests/api/live/live-views.ts b/server/tests/api/live/live-views.ts
index 4a137b185..5e3a79c64 100644
--- a/server/tests/api/live/live-views.ts
+++ b/server/tests/api/live/live-views.ts
@@ -6,8 +6,8 @@ import { FfmpegCommand } from 'fluent-ffmpeg'
6import { VideoPrivacy } from '@shared/models' 6import { VideoPrivacy } from '@shared/models'
7import { 7import {
8 cleanupTests, 8 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 9 createMultipleServers,
10 doubleFollow,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultVideoChannel, 13 setDefaultVideoChannel,
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts
index 88995910c..4676a840a 100644
--- a/server/tests/api/live/live.ts
+++ b/server/tests/api/live/live.ts
@@ -4,19 +4,18 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils' 6import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 checkLiveCleanup, 8 checkLiveCleanup,
10 checkLiveSegmentHash, 9 checkLiveSegmentHash,
11 checkResolutionsInMasterPlaylist, 10 checkResolutionsInMasterPlaylist,
12 cleanupTests, 11 cleanupTests,
13 doubleFollow,
14 createMultipleServers, 12 createMultipleServers,
13 doubleFollow,
15 killallServers, 14 killallServers,
16 LiveCommand, 15 LiveCommand,
17 makeRawRequest, 16 makeRawRequest,
18 sendRTMPStream,
19 PeerTubeServer, 17 PeerTubeServer,
18 sendRTMPStream,
20 setAccessTokensToServers, 19 setAccessTokensToServers,
21 setDefaultVideoChannel, 20 setDefaultVideoChannel,
22 stopFfmpeg, 21 stopFfmpeg,
@@ -26,7 +25,15 @@ import {
26 waitJobs, 25 waitJobs,
27 waitUntilLivePublishedOnAllServers 26 waitUntilLivePublishedOnAllServers
28} from '@shared/extra-utils' 27} from '@shared/extra-utils'
29import { LiveVideo, LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' 28import {
29 HttpStatusCode,
30 LiveVideo,
31 LiveVideoCreate,
32 VideoDetails,
33 VideoPrivacy,
34 VideoState,
35 VideoStreamingPlaylistType
36} from '@shared/models'
30 37
31const expect = chai.expect 38const expect = chai.expect
32 39
diff --git a/server/tests/api/moderation/blocklist-notification.ts b/server/tests/api/moderation/blocklist-notification.ts
index fdfbcbced..75b15c298 100644
--- a/server/tests/api/moderation/blocklist-notification.ts
+++ b/server/tests/api/moderation/blocklist-notification.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6import { UserNotificationType } from '@shared/models' 6import { UserNotificationType } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts
index 593291e87..8ed5ad9e5 100644
--- a/server/tests/api/moderation/blocklist.ts
+++ b/server/tests/api/moderation/blocklist.ts
@@ -6,8 +6,8 @@ import {
6 BlocklistCommand, 6 BlocklistCommand,
7 cleanupTests, 7 cleanupTests,
8 CommentsCommand, 8 CommentsCommand,
9 doubleFollow,
10 createMultipleServers, 9 createMultipleServers,
10 doubleFollow,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 waitJobs 13 waitJobs
diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts
index d65551f0a..b36ba11a9 100644
--- a/server/tests/api/notifications/admin-notifications.ts
+++ b/server/tests/api/notifications/admin-notifications.ts
@@ -9,8 +9,8 @@ import {
9 cleanupTests, 9 cleanupTests,
10 MockJoinPeerTubeVersions, 10 MockJoinPeerTubeVersions,
11 MockSmtpServer, 11 MockSmtpServer,
12 prepareNotificationsTest,
13 PeerTubeServer, 12 PeerTubeServer,
13 prepareNotificationsTest,
14 wait 14 wait
15} from '@shared/extra-utils' 15} from '@shared/extra-utils'
16import { PluginType, UserNotification, UserNotificationType } from '@shared/models' 16import { PluginType, UserNotification, UserNotificationType } from '@shared/models'
diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts
index d54819aaa..cbb46e510 100644
--- a/server/tests/api/notifications/comments-notifications.ts
+++ b/server/tests/api/notifications/comments-notifications.ts
@@ -8,8 +8,8 @@ import {
8 checkNewCommentOnMyVideo, 8 checkNewCommentOnMyVideo,
9 cleanupTests, 9 cleanupTests,
10 MockSmtpServer, 10 MockSmtpServer,
11 prepareNotificationsTest,
12 PeerTubeServer, 11 PeerTubeServer,
12 prepareNotificationsTest,
13 waitJobs 13 waitJobs
14} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { UserNotification } from '@shared/models' 15import { UserNotification } from '@shared/models'
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 3a294192b..6e8f8a2b4 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -19,8 +19,8 @@ import {
19 cleanupTests, 19 cleanupTests,
20 MockInstancesIndex, 20 MockInstancesIndex,
21 MockSmtpServer, 21 MockSmtpServer,
22 prepareNotificationsTest,
23 PeerTubeServer, 22 PeerTubeServer,
23 prepareNotificationsTest,
24 wait, 24 wait,
25 waitJobs 25 waitJobs
26} from '@shared/extra-utils' 26} from '@shared/extra-utils'
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts
index 178b20687..fa4b53db6 100644
--- a/server/tests/api/notifications/notifications-api.ts
+++ b/server/tests/api/notifications/notifications-api.ts
@@ -8,8 +8,8 @@ import {
8 cleanupTests, 8 cleanupTests,
9 getAllNotificationsSettings, 9 getAllNotificationsSettings,
10 MockSmtpServer, 10 MockSmtpServer,
11 prepareNotificationsTest,
12 PeerTubeServer, 11 PeerTubeServer,
12 prepareNotificationsTest,
13 waitJobs 13 waitJobs
14} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { UserNotification, UserNotificationSettingValue } from '@shared/models' 15import { UserNotification, UserNotificationSettingValue } from '@shared/models'
diff --git a/server/tests/api/redundancy/manage-redundancy.ts b/server/tests/api/redundancy/manage-redundancy.ts
index aff64e2eb..5fd464ded 100644
--- a/server/tests/api/redundancy/manage-redundancy.ts
+++ b/server/tests/api/redundancy/manage-redundancy.ts
@@ -4,10 +4,10 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
9 RedundancyCommand, 8 doubleFollow,
10 PeerTubeServer, 9 PeerTubeServer,
10 RedundancyCommand,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 waitJobs 12 waitJobs
13} from '@shared/extra-utils' 13} from '@shared/extra-utils'
diff --git a/server/tests/api/redundancy/redundancy-constraints.ts b/server/tests/api/redundancy/redundancy-constraints.ts
index 71b93901e..25cd11658 100644
--- a/server/tests/api/redundancy/redundancy-constraints.ts
+++ b/server/tests/api/redundancy/redundancy-constraints.ts
@@ -2,14 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { 5import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6 cleanupTests,
7 createSingleServer,
8 killallServers,
9 PeerTubeServer,
10 setAccessTokensToServers,
11 waitJobs
12} from '@shared/extra-utils'
13import { VideoPrivacy } from '@shared/models' 6import { VideoPrivacy } from '@shared/models'
14 7
15describe('Test redundancy constraints', function () { 8describe('Test redundancy constraints', function () {
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts
index 921a48856..a6559d304 100644
--- a/server/tests/api/redundancy/redundancy.ts
+++ b/server/tests/api/redundancy/redundancy.ts
@@ -5,22 +5,21 @@ import * as chai from 'chai'
5import { readdir } from 'fs-extra' 5import { readdir } from 'fs-extra'
6import * as magnetUtil from 'magnet-uri' 6import * as magnetUtil from 'magnet-uri'
7import { join } from 'path' 7import { join } from 'path'
8import { HttpStatusCode } from '@shared/models'
9import { 8import {
10 checkSegmentHash, 9 checkSegmentHash,
11 checkVideoFilesWereRemoved, 10 checkVideoFilesWereRemoved,
12 cleanupTests, 11 cleanupTests,
13 doubleFollow,
14 createMultipleServers, 12 createMultipleServers,
13 doubleFollow,
15 killallServers, 14 killallServers,
16 makeGetRequest, 15 makeGetRequest,
17 root,
18 PeerTubeServer, 16 PeerTubeServer,
17 root,
19 setAccessTokensToServers, 18 setAccessTokensToServers,
20 wait, 19 wait,
21 waitJobs 20 waitJobs
22} from '@shared/extra-utils' 21} from '@shared/extra-utils'
23import { VideoPrivacy, VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '@shared/models' 22import { HttpStatusCode, VideoPrivacy, VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '@shared/models'
24 23
25const expect = chai.expect 24const expect = chai.expect
26 25
diff --git a/server/tests/api/search/search-activitypub-video-channels.ts b/server/tests/api/search/search-activitypub-video-channels.ts
index b33f28266..426cbc8e1 100644
--- a/server/tests/api/search/search-activitypub-video-channels.ts
+++ b/server/tests/api/search/search-activitypub-video-channels.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 createMultipleServers, 7 createMultipleServers,
8 SearchCommand,
9 PeerTubeServer, 8 PeerTubeServer,
9 SearchCommand,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
12 waitJobs 12 waitJobs
diff --git a/server/tests/api/search/search-activitypub-video-playlists.ts b/server/tests/api/search/search-activitypub-video-playlists.ts
index ada2d3d6c..33ca7be12 100644
--- a/server/tests/api/search/search-activitypub-video-playlists.ts
+++ b/server/tests/api/search/search-activitypub-video-playlists.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 createMultipleServers, 7 createMultipleServers,
8 SearchCommand,
9 PeerTubeServer, 8 PeerTubeServer,
9 SearchCommand,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel, 11 setDefaultVideoChannel,
12 wait, 12 wait,
diff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.ts
index a015b72a7..b3cfcacca 100644
--- a/server/tests/api/search/search-activitypub-videos.ts
+++ b/server/tests/api/search/search-activitypub-videos.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 createMultipleServers, 7 createMultipleServers,
8 SearchCommand,
9 PeerTubeServer, 8 PeerTubeServer,
9 SearchCommand,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
12 waitJobs 12 waitJobs
diff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.ts
index 07e00a214..4da2d0ece 100644
--- a/server/tests/api/search/search-channels.ts
+++ b/server/tests/api/search/search-channels.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, createSingleServer, SearchCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/extra-utils'
6import { VideoChannel } from '@shared/models' 6import { VideoChannel } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.ts
index 38edcf7c6..feb35411f 100644
--- a/server/tests/api/search/search-index.ts
+++ b/server/tests/api/search/search-index.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, createSingleServer, SearchCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/extra-utils'
6import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models' 6import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
diff --git a/server/tests/api/search/search-playlists.ts b/server/tests/api/search/search-playlists.ts
index b29c2d127..22e9b8fca 100644
--- a/server/tests/api/search/search-playlists.ts
+++ b/server/tests/api/search/search-playlists.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 createSingleServer, 7 createSingleServer,
8 SearchCommand,
9 PeerTubeServer, 8 PeerTubeServer,
9 SearchCommand,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel 11 setDefaultVideoChannel
12} from '@shared/extra-utils' 12} from '@shared/extra-utils'
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index a9b0a4fcd..f834c7f36 100644
--- a/server/tests/api/search/search-videos.ts
+++ b/server/tests/api/search/search-videos.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 createSingleServer, 7 createSingleServer,
8 SearchCommand,
9 PeerTubeServer, 8 PeerTubeServer,
9 SearchCommand,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel, 11 setDefaultVideoChannel,
12 stopFfmpeg, 12 stopFfmpeg,
diff --git a/server/tests/api/server/bulk.ts b/server/tests/api/server/bulk.ts
index 5d8c87983..16cbcd5c3 100644
--- a/server/tests/api/server/bulk.ts
+++ b/server/tests/api/server/bulk.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 BulkCommand, 6 BulkCommand,
7 cleanupTests, 7 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 waitJobs 12 waitJobs
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts
index a1c2f0f39..fd61e95df 100644
--- a/server/tests/api/server/config.ts
+++ b/server/tests/api/server/config.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -12,7 +11,7 @@ import {
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers 12 setAccessTokensToServers
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { CustomConfig } from '@shared/models' 14import { CustomConfig, HttpStatusCode } from '@shared/models'
16 15
17const expect = chai.expect 16const expect = chai.expect
18 17
diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts
index fc5d0ad6a..c555661ad 100644
--- a/server/tests/api/server/contact-form.ts
+++ b/server/tests/api/server/contact-form.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 ContactFormCommand, 7 ContactFormCommand,
@@ -13,6 +12,7 @@ import {
13 wait, 12 wait,
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { HttpStatusCode } from '@shared/models'
16 16
17const expect = chai.expect 17const expect = chai.expect
18 18
diff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.ts
index 4c5b296ee..ae86b380f 100644
--- a/server/tests/api/server/email.ts
+++ b/server/tests/api/server/email.ts
@@ -2,8 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6import { HttpStatusCode } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
9 9
diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.ts
index bd7b215db..471f5d8d0 100644
--- a/server/tests/api/server/follow-constraints.ts
+++ b/server/tests/api/server/follow-constraints.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
6import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 6import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
7import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
8 7
9const expect = chai.expect 8const expect = chai.expect
10 9
@@ -157,7 +156,7 @@ describe('Test follow constraints', function () {
157 156
158 it('Should list local account videos', async function () { 157 it('Should list local account videos', async function () {
159 const { total, data } = await servers[0].videos.listByAccount({ 158 const { total, data } = await servers[0].videos.listByAccount({
160 token: undefined, 159 token: null,
161 handle: 'root@localhost:' + servers[0].port 160 handle: 'root@localhost:' + servers[0].port
162 }) 161 })
163 162
@@ -167,7 +166,7 @@ describe('Test follow constraints', function () {
167 166
168 it('Should not list remote account videos', async function () { 167 it('Should not list remote account videos', async function () {
169 const { total, data } = await servers[0].videos.listByAccount({ 168 const { total, data } = await servers[0].videos.listByAccount({
170 token: undefined, 169 token: null,
171 handle: 'root@localhost:' + servers[1].port 170 handle: 'root@localhost:' + servers[1].port
172 }) 171 })
173 172
@@ -177,7 +176,7 @@ describe('Test follow constraints', function () {
177 176
178 it('Should list local channel videos', async function () { 177 it('Should list local channel videos', async function () {
179 const handle = 'root_channel@localhost:' + servers[0].port 178 const handle = 'root_channel@localhost:' + servers[0].port
180 const { total, data } = await servers[0].videos.listByChannel({ token: undefined, handle }) 179 const { total, data } = await servers[0].videos.listByChannel({ token: null, handle })
181 180
182 expect(total).to.equal(1) 181 expect(total).to.equal(1)
183 expect(data).to.have.lengthOf(1) 182 expect(data).to.have.lengthOf(1)
@@ -185,7 +184,7 @@ describe('Test follow constraints', function () {
185 184
186 it('Should not list remote channel videos', async function () { 185 it('Should not list remote channel videos', async function () {
187 const handle = 'root_channel@localhost:' + servers[1].port 186 const handle = 'root_channel@localhost:' + servers[1].port
188 const { total, data } = await servers[0].videos.listByChannel({ token: undefined, handle }) 187 const { total, data } = await servers[0].videos.listByChannel({ token: null, handle })
189 188
190 expect(total).to.equal(0) 189 expect(total).to.equal(0)
191 expect(data).to.have.lengthOf(0) 190 expect(data).to.have.lengthOf(0)
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts
index 8856177b8..ff8f880a6 100644
--- a/server/tests/api/server/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -5,9 +5,9 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 completeVideoCheck, 7 completeVideoCheck,
8 createMultipleServers,
8 dateIsValid, 9 dateIsValid,
9 expectAccountFollows, 10 expectAccountFollows,
10 createMultipleServers,
11 FollowsCommand, 11 FollowsCommand,
12 PeerTubeServer, 12 PeerTubeServer,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts
index d22e843e0..1f751c957 100644
--- a/server/tests/api/server/handle-down.ts
+++ b/server/tests/api/server/handle-down.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 CommentsCommand, 7 CommentsCommand,
@@ -14,7 +13,7 @@ import {
14 wait, 13 wait,
15 waitJobs 14 waitJobs
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
17import { JobState, VideoCreateResult, VideoPrivacy } from '@shared/models' 16import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'
18 17
19const expect = chai.expect 18const expect = chai.expect
20 19
diff --git a/server/tests/api/server/homepage.ts b/server/tests/api/server/homepage.ts
index 7eae3df20..cb3ba5677 100644
--- a/server/tests/api/server/homepage.ts
+++ b/server/tests/api/server/homepage.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode } from '@shared/models'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 CustomPagesCommand,
9 createSingleServer, 8 createSingleServer,
9 CustomPagesCommand,
10 killallServers, 10 killallServers,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers 12 setAccessTokensToServers
diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts
index 376cd10d0..c10c154c2 100644
--- a/server/tests/api/server/jobs.ts
+++ b/server/tests/api/server/jobs.ts
@@ -4,9 +4,9 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 createMultipleServers,
7 dateIsValid, 8 dateIsValid,
8 doubleFollow, 9 doubleFollow,
9 createMultipleServers,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 waitJobs 12 waitJobs
diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts
index 334adfe9d..5f9f4ffdd 100644
--- a/server/tests/api/server/plugins.ts
+++ b/server/tests/api/server/plugins.ts
@@ -2,18 +2,17 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
9 killallServers, 8 killallServers,
10 PluginsCommand,
11 PeerTubeServer, 9 PeerTubeServer,
10 PluginsCommand,
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 testHelloWorldRegisteredSettings, 12 testHelloWorldRegisteredSettings,
14 wait 13 wait
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { PluginType } from '@shared/models' 15import { HttpStatusCode, PluginType } from '@shared/models'
17 16
18const expect = chai.expect 17const expect = chai.expect
19 18
diff --git a/server/tests/api/server/reverse-proxy.ts b/server/tests/api/server/reverse-proxy.ts
index 13b22bc0e..484f88d67 100644
--- a/server/tests/api/server/reverse-proxy.ts
+++ b/server/tests/api/server/reverse-proxy.ts
@@ -1,8 +1,8 @@
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 { expect } from 'chai' 3import { expect } from 'chai'
4import { HttpStatusCode } from '@shared/models'
5import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' 4import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils'
5import { HttpStatusCode } from '@shared/models'
6 6
7describe('Test application behind a reverse proxy', function () { 7describe('Test application behind a reverse proxy', function () {
8 let server: PeerTubeServer 8 let server: PeerTubeServer
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index f07d0fd39..942602b70 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts
index d2bb9c387..565b4bd77 100644
--- a/server/tests/api/users/user-subscriptions.ts
+++ b/server/tests/api/users/user-subscriptions.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 SubscriptionsCommand, 11 SubscriptionsCommand,
@@ -67,7 +67,8 @@ describe('Test users subscriptions', function () {
67 67
68 await waitJobs(servers) 68 await waitJobs(servers)
69 69
70 const { uuid } = await servers[2].videos.upload({ attributes: { name: 'video server 3 added after follow' } }) 70 const attributes = { name: 'video server 3 added after follow' }
71 const { uuid } = await servers[2].videos.upload({ token: users[2].accessToken, attributes })
71 video3UUID = uuid 72 video3UUID = uuid
72 73
73 await waitJobs(servers) 74 await waitJobs(servers)
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts
index e304e5d67..225145957 100644
--- a/server/tests/api/users/users-multiple-servers.ts
+++ b/server/tests/api/users/users-multiple-servers.ts
@@ -7,8 +7,8 @@ import {
7 checkTmpIsEmpty, 7 checkTmpIsEmpty,
8 checkVideoFilesWereRemoved, 8 checkVideoFilesWereRemoved,
9 cleanupTests, 9 cleanupTests,
10 doubleFollow,
11 createMultipleServers, 10 createMultipleServers,
11 doubleFollow,
12 PeerTubeServer, 12 PeerTubeServer,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 testImage, 14 testImage,
diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts
index 56fc25048..f54463359 100644
--- a/server/tests/api/users/users-verification.ts
+++ b/server/tests/api/users/users-verification.ts
@@ -2,8 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6import { HttpStatusCode } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
9 9
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index be80c2616..066da88ee 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -13,7 +12,7 @@ import {
13 testImage, 12 testImage,
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { AbuseState, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models' 15import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models'
17 16
18const expect = chai.expect 17const expect = chai.expect
19 18
diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts
index b9bf96650..15c3ae6d6 100644
--- a/server/tests/api/videos/audio-only.ts
+++ b/server/tests/api/videos/audio-only.ts
@@ -4,7 +4,7 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' 6import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils'
7import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 7import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
8 8
9const expect = chai.expect 9const expect = chai.expect
10 10
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index edf2773cd..d916abb09 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -3,16 +3,15 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import * as request from 'supertest' 5import * as request from 'supertest'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 buildAbsoluteFixturePath, 7 buildAbsoluteFixturePath,
9 checkTmpIsEmpty, 8 checkTmpIsEmpty,
10 checkVideoFilesWereRemoved, 9 checkVideoFilesWereRemoved,
11 cleanupTests, 10 cleanupTests,
12 completeVideoCheck, 11 completeVideoCheck,
12 createMultipleServers,
13 dateIsValid, 13 dateIsValid,
14 doubleFollow, 14 doubleFollow,
15 createMultipleServers,
16 PeerTubeServer, 15 PeerTubeServer,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 testImage, 17 testImage,
@@ -20,7 +19,7 @@ import {
20 waitJobs, 19 waitJobs,
21 webtorrentAdd 20 webtorrentAdd
22} from '@shared/extra-utils' 21} from '@shared/extra-utils'
23import { VideoCommentThreadTree, VideoPrivacy } from '@shared/models' 22import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
24 23
25const expect = chai.expect 24const expect = chai.expect
26 25
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts
index 0e62972c2..13e47c85e 100644
--- a/server/tests/api/videos/resumable-upload.ts
+++ b/server/tests/api/videos/resumable-upload.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { pathExists, readdir, stat } from 'fs-extra' 5import { pathExists, readdir, stat } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 buildAbsoluteFixturePath, 8 buildAbsoluteFixturePath,
10 cleanupTests, 9 cleanupTests,
@@ -13,7 +12,7 @@ import {
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel 13 setDefaultVideoChannel
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { VideoPrivacy } from '@shared/models' 15import { HttpStatusCode, VideoPrivacy } from '@shared/models'
17 16
18const expect = chai.expect 17const expect = chai.expect
19 18
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts
index 6caba6aa6..e3d46e619 100644
--- a/server/tests/api/videos/video-captions.ts
+++ b/server/tests/api/videos/video-captions.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 checkVideoFilesWereRemoved, 6 checkVideoFilesWereRemoved,
7 cleanupTests, 7 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 testCaptionFile, 12 testCaptionFile,
diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts
index 792550101..6ae6d3004 100644
--- a/server/tests/api/videos/video-change-ownership.ts
+++ b/server/tests/api/videos/video-change-ownership.ts
@@ -2,19 +2,18 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 ChangeOwnershipCommand, 6 ChangeOwnershipCommand,
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
11 createSingleServer, 9 createSingleServer,
10 doubleFollow,
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel, 13 setDefaultVideoChannel,
15 waitJobs 14 waitJobs
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
17import { VideoPrivacy } from '@shared/models' 16import { HttpStatusCode, VideoPrivacy } from '@shared/models'
18 17
19const expect = chai.expect 18const expect = chai.expect
20 19
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index eeaec5ad2..c25754eb6 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -6,8 +6,8 @@ import { basename } from 'path'
6import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' 6import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants'
7import { 7import {
8 cleanupTests, 8 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 9 createMultipleServers,
10 doubleFollow,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultVideoChannel, 13 setDefaultVideoChannel,
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts
index 9709e0628..61ee54540 100644
--- a/server/tests/api/videos/video-comments.ts
+++ b/server/tests/api/videos/video-comments.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 CommentsCommand, 7 CommentsCommand,
8 dateIsValid,
9 createSingleServer, 8 createSingleServer,
9 dateIsValid,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 testImage 12 testImage
diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts
index ce45eac80..d22b4ed96 100644
--- a/server/tests/api/videos/video-description.ts
+++ b/server/tests/api/videos/video-description.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6 6
7const expect = chai.expect 7const expect = chai.expect
8 8
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts
index df030110b..7845f7334 100644
--- a/server/tests/api/videos/video-hls.ts
+++ b/server/tests/api/videos/video-hls.ts
@@ -3,22 +3,21 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 checkDirectoryIsEmpty, 7 checkDirectoryIsEmpty,
9 checkResolutionsInMasterPlaylist, 8 checkResolutionsInMasterPlaylist,
10 checkSegmentHash, 9 checkSegmentHash,
11 checkTmpIsEmpty, 10 checkTmpIsEmpty,
12 cleanupTests, 11 cleanupTests,
13 doubleFollow,
14 createMultipleServers, 12 createMultipleServers,
13 doubleFollow,
15 makeRawRequest, 14 makeRawRequest,
16 PeerTubeServer, 15 PeerTubeServer,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 waitJobs, 17 waitJobs,
19 webtorrentAdd 18 webtorrentAdd
20} from '@shared/extra-utils' 19} from '@shared/extra-utils'
21import { VideoStreamingPlaylistType } from '@shared/models' 20import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models'
22import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' 21import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants'
23 22
24const expect = chai.expect 23const expect = chai.expect
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts
index 0a9e5ce3f..b5d183d62 100644
--- a/server/tests/api/videos/video-nsfw.ts
+++ b/server/tests/api/videos/video-nsfw.ts
@@ -30,8 +30,8 @@ describe('Test video NSFW policy', function () {
30 promises = [ 30 promises = [
31 server.search.advancedVideoSearch({ token, search: { search: 'n', sort: '-publishedAt', ...query } }), 31 server.search.advancedVideoSearch({ token, search: { search: 'n', sort: '-publishedAt', ...query } }),
32 server.videos.listWithToken({ token, ...query }), 32 server.videos.listWithToken({ token, ...query }),
33 server.videos.listByAccount({ token, handle: channelName, ...query }), 33 server.videos.listByAccount({ token, handle: accountName, ...query }),
34 server.videos.listByChannel({ token, handle: accountName, ...query }) 34 server.videos.listByChannel({ token, handle: channelName, ...query })
35 ] 35 ]
36 36
37 // Overviews do not support video filters 37 // Overviews do not support video filters
@@ -47,8 +47,8 @@ describe('Test video NSFW policy', function () {
47 promises = [ 47 promises = [
48 server.search.searchVideos({ search: 'n', sort: '-publishedAt' }), 48 server.search.searchVideos({ search: 'n', sort: '-publishedAt' }),
49 server.videos.list(), 49 server.videos.list(),
50 server.videos.listByAccount({ handle: channelName }), 50 server.videos.listByAccount({ token: null, handle: accountName }),
51 server.videos.listByChannel({ handle: accountName }) 51 server.videos.listByChannel({ token: null, handle: channelName })
52 ] 52 ]
53 53
54 // Overviews do not support video filters 54 // Overviews do not support video filters
@@ -82,6 +82,7 @@ describe('Test video NSFW policy', function () {
82 }) 82 })
83 83
84 describe('Instance default NSFW policy', function () { 84 describe('Instance default NSFW policy', function () {
85
85 it('Should display NSFW videos with display default NSFW policy', async function () { 86 it('Should display NSFW videos with display default NSFW policy', async function () {
86 const serverConfig = await server.config.getConfig() 87 const serverConfig = await server.config.getConfig()
87 expect(serverConfig.instance.defaultNSFWPolicy).to.equal('display') 88 expect(serverConfig.instance.defaultNSFWPolicy).to.equal('display')
diff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.ts
index 9a682c12b..f0b2ca169 100644
--- a/server/tests/api/videos/video-playlist-thumbnails.ts
+++ b/server/tests/api/videos/video-playlist-thumbnails.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel, 11 setDefaultVideoChannel,
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
index 9a28a421a..f42aee2ff 100644
--- a/server/tests/api/videos/video-playlists.ts
+++ b/server/tests/api/videos/video-playlists.ts
@@ -2,14 +2,13 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 checkPlaylistFilesWereRemoved, 6 checkPlaylistFilesWereRemoved,
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
11 PlaylistsCommand, 9 doubleFollow,
12 PeerTubeServer, 10 PeerTubeServer,
11 PlaylistsCommand,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel, 13 setDefaultVideoChannel,
15 testImage, 14 testImage,
@@ -17,6 +16,7 @@ import {
17 waitJobs 16 waitJobs
18} from '@shared/extra-utils' 17} from '@shared/extra-utils'
19import { 18import {
19 HttpStatusCode,
20 VideoPlaylist, 20 VideoPlaylist,
21 VideoPlaylistCreateResult, 21 VideoPlaylistCreateResult,
22 VideoPlaylistElementType, 22 VideoPlaylistElementType,
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index 06011082d..b51b3bcdd 100644
--- a/server/tests/api/videos/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6import { cleanupTests, doubleFollow, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 6import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
7import { VideoCreateResult, VideoPrivacy } from '@shared/models'
8 7
9const expect = chai.expect 8const expect = chai.expect
10 9
@@ -162,7 +161,7 @@ describe('Test video privacy', function () {
162 }) 161 })
163 162
164 it('Should not be able to get this unlisted video using its id', async function () { 163 it('Should not be able to get this unlisted video using its id', async function () {
165 await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 164 await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
166 }) 165 })
167 166
168 it('Should be able to get this unlisted video using its uuid/shortUUID', async function () { 167 it('Should be able to get this unlisted video using its uuid/shortUUID', async function () {
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts
index 22b5cf1c2..3f7738784 100644
--- a/server/tests/api/videos/video-schedule-update.ts
+++ b/server/tests/api/videos/video-schedule-update.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 7510472e3..e4892bb24 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -4,12 +4,11 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { join } from 'path' 6import { join } from 'path'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 buildAbsoluteFixturePath, 8 buildAbsoluteFixturePath,
10 cleanupTests, 9 cleanupTests,
11 doubleFollow,
12 createMultipleServers, 10 createMultipleServers,
11 doubleFollow,
13 generateHighBitrateVideo, 12 generateHighBitrateVideo,
14 generateVideoWithFramerate, 13 generateVideoWithFramerate,
15 makeGetRequest, 14 makeGetRequest,
@@ -18,7 +17,7 @@ import {
18 waitJobs, 17 waitJobs,
19 webtorrentAdd 18 webtorrentAdd
20} from '@shared/extra-utils' 19} from '@shared/extra-utils'
21import { getMaxBitrate, VideoResolution, VideoState } from '@shared/models' 20import { getMaxBitrate, HttpStatusCode, VideoResolution, VideoState } from '@shared/models'
22import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' 21import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants'
23import { 22import {
24 canDoQuickTranscode, 23 canDoQuickTranscode,
diff --git a/server/tests/api/videos/videos-filter.ts b/server/tests/api/videos/videos-filter.ts
index 88dff3e7f..2306807bf 100644
--- a/server/tests/api/videos/videos-filter.ts
+++ b/server/tests/api/videos/videos-filter.ts
@@ -2,16 +2,15 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
10 makeGetRequest, 9 makeGetRequest,
11 PeerTubeServer, 10 PeerTubeServer,
12 setAccessTokensToServers 11 setAccessTokensToServers
13} from '@shared/extra-utils' 12} from '@shared/extra-utils'
14import { UserRole, Video, VideoPrivacy } from '@shared/models' 13import { HttpStatusCode, UserRole, Video, VideoPrivacy } from '@shared/models'
15 14
16async function getVideosNames (server: PeerTubeServer, token: string, filter: string, expectedStatus = HttpStatusCode.OK_200) { 15async function getVideosNames (server: PeerTubeServer, token: string, filter: string, expectedStatus = HttpStatusCode.OK_200) {
17 const paths = [ 16 const paths = [
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts
index acb9d1a46..e4bc0bb3a 100644
--- a/server/tests/api/videos/videos-history.ts
+++ b/server/tests/api/videos/videos-history.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -12,7 +11,7 @@ import {
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 wait 12 wait
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { Video } from '@shared/models' 14import { HttpStatusCode, Video } from '@shared/models'
16 15
17const expect = chai.expect 16const expect = chai.expect
18 17
diff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.ts
index 0be03ddd2..82268b1be 100644
--- a/server/tests/api/videos/videos-views-cleaner.ts
+++ b/server/tests/api/videos/videos-views-cleaner.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 killallServers, 9 killallServers,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts
index e8cd71e09..bddcff5e7 100644
--- a/server/tests/cli/create-import-video-file-job.ts
+++ b/server/tests/cli/create-import-video-file-job.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6import { VideoFile } from '@shared/models' 6import { VideoFile } from '@shared/models'
7 7
8const expect = chai.expect 8const expect = chai.expect
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts
index 53f187f90..df787ccdc 100644
--- a/server/tests/cli/create-transcoding-job.ts
+++ b/server/tests/cli/create-transcoding-job.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 waitJobs 11 waitJobs
diff --git a/server/tests/cli/optimize-old-videos.ts b/server/tests/cli/optimize-old-videos.ts
index 53f47a85e..685b3b7b8 100644
--- a/server/tests/cli/optimize-old-videos.ts
+++ b/server/tests/cli/optimize-old-videos.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
10 generateHighBitrateVideo, 10 generateHighBitrateVideo,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
diff --git a/server/tests/cli/plugins.ts b/server/tests/cli/plugins.ts
index 42651d79c..07c78cc89 100644
--- a/server/tests/cli/plugins.ts
+++ b/server/tests/cli/plugins.ts
@@ -6,8 +6,8 @@ import {
6 cleanupTests, 6 cleanupTests,
7 createSingleServer, 7 createSingleServer,
8 killallServers, 8 killallServers,
9 PluginsCommand,
10 PeerTubeServer, 9 PeerTubeServer,
10 PluginsCommand,
11 setAccessTokensToServers 11 setAccessTokensToServers
12} from '../../../shared/extra-utils' 12} from '../../../shared/extra-utils'
13 13
diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts
index 2bd4a466b..954a87833 100644
--- a/server/tests/cli/prune-storage.ts
+++ b/server/tests/cli/prune-storage.ts
@@ -5,12 +5,11 @@ import * as chai from 'chai'
5import { createFile, readdir } from 'fs-extra' 5import { createFile, readdir } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { buildUUID } from '@server/helpers/uuid' 7import { buildUUID } from '@server/helpers/uuid'
8import { HttpStatusCode } from '@shared/models'
9import { 8import {
10 cleanupTests, 9 cleanupTests,
11 CLICommand, 10 CLICommand,
12 doubleFollow,
13 createMultipleServers, 11 createMultipleServers,
12 doubleFollow,
14 killallServers, 13 killallServers,
15 makeGetRequest, 14 makeGetRequest,
16 PeerTubeServer, 15 PeerTubeServer,
@@ -19,7 +18,7 @@ import {
19 wait, 18 wait,
20 waitJobs 19 waitJobs
21} from '@shared/extra-utils' 20} from '@shared/extra-utils'
22import { VideoPlaylistPrivacy } from '@shared/models' 21import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
23 22
24const expect = chai.expect 23const expect = chai.expect
25 24
diff --git a/server/tests/cli/regenerate-thumbnails.ts b/server/tests/cli/regenerate-thumbnails.ts
index 595d842ef..780c9b4bd 100644
--- a/server/tests/cli/regenerate-thumbnails.ts
+++ b/server/tests/cli/regenerate-thumbnails.ts
@@ -2,12 +2,11 @@ import 'mocha'
2import { expect } from 'chai' 2import { expect } from 'chai'
3import { writeFile } from 'fs-extra' 3import { writeFile } from 'fs-extra'
4import { basename, join } from 'path' 4import { basename, join } from 'path'
5import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode, Video } from '@shared/models'
6import { Video } from '@shared/models'
7import { 6import {
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
11 makeRawRequest, 10 makeRawRequest,
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
diff --git a/server/tests/client.ts b/server/tests/client.ts
index 6255c6961..9c27a7aae 100644
--- a/server/tests/client.ts
+++ b/server/tests/client.ts
@@ -3,12 +3,11 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { HttpStatusCode } from '@shared/models' 6import { Account, HTMLServerConfig, HttpStatusCode, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy } from '@shared/models'
7import { Account, HTMLServerConfig, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy } from '@shared/models'
8import { 7import {
9 cleanupTests, 8 cleanupTests,
10 doubleFollow,
11 createMultipleServers, 9 createMultipleServers,
10 doubleFollow,
12 makeGetRequest, 11 makeGetRequest,
13 makeHTMLRequest, 12 makeHTMLRequest,
14 PeerTubeServer, 13 PeerTubeServer,
diff --git a/server/tests/external-plugins/auth-ldap.ts b/server/tests/external-plugins/auth-ldap.ts
index 12b4a1b8d..acec69df5 100644
--- a/server/tests/external-plugins/auth-ldap.ts
+++ b/server/tests/external-plugins/auth-ldap.ts
@@ -2,8 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
6import { HttpStatusCode } from '@shared/models'
7 7
8describe('Official plugin auth-ldap', function () { 8describe('Official plugin auth-ldap', function () {
9 let server: PeerTubeServer 9 let server: PeerTubeServer
diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.ts
index 78b13eded..0eb4bda9a 100644
--- a/server/tests/external-plugins/auto-block-videos.ts
+++ b/server/tests/external-plugins/auto-block-videos.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 killallServers, 9 killallServers,
10 MockBlocklist, 10 MockBlocklist,
11 PeerTubeServer, 11 PeerTubeServer,
diff --git a/server/tests/external-plugins/auto-mute.ts b/server/tests/external-plugins/auto-mute.ts
index b2046313b..271779dd4 100644
--- a/server/tests/external-plugins/auto-mute.ts
+++ b/server/tests/external-plugins/auto-mute.ts
@@ -2,11 +2,10 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
10 killallServers, 9 killallServers,
11 makeGetRequest, 10 makeGetRequest,
12 MockBlocklist, 11 MockBlocklist,
@@ -14,6 +13,7 @@ import {
14 setAccessTokensToServers, 13 setAccessTokensToServers,
15 wait 14 wait
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
16import { HttpStatusCode } from '@shared/models'
17 17
18describe('Official plugin auto-mute', function () { 18describe('Official plugin auto-mute', function () {
19 const autoMuteListPath = '/plugins/auto-mute/router/api/v1/mute-list' 19 const autoMuteListPath = '/plugins/auto-mute/router/api/v1/mute-list'
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts
index 543c431dd..5667207c0 100644
--- a/server/tests/feeds/feeds.ts
+++ b/server/tests/feeds/feeds.ts
@@ -3,17 +3,16 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import * as xmlParser from 'fast-xml-parser' 5import * as xmlParser from 'fast-xml-parser'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
11 createSingleServer, 9 createSingleServer,
10 doubleFollow,
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { VideoPrivacy } from '@shared/models' 15import { HttpStatusCode, VideoPrivacy } from '@shared/models'
17 16
18chai.use(require('chai-xml')) 17chai.use(require('chai-xml'))
19chai.use(require('chai-json-schema')) 18chai.use(require('chai-json-schema'))
diff --git a/server/tests/helpers/comment-model.ts b/server/tests/helpers/comment-model.ts
index 4c51b7000..31dc6ec72 100644
--- a/server/tests/helpers/comment-model.ts
+++ b/server/tests/helpers/comment-model.ts
@@ -1,7 +1,7 @@
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'
4import 'mocha' 3import 'mocha'
4import * as chai from 'chai'
5import { VideoCommentModel } from '../../models/video/video-comment' 5import { VideoCommentModel } from '../../models/video/video-comment'
6 6
7const expect = chai.expect 7const expect = chai.expect
diff --git a/server/tests/helpers/core-utils.ts b/server/tests/helpers/core-utils.ts
index c028b316d..d5cac51a3 100644
--- a/server/tests/helpers/core-utils.ts
+++ b/server/tests/helpers/core-utils.ts
@@ -1,10 +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'
4import 'mocha' 3import 'mocha'
4import * as chai from 'chai'
5import { snakeCase } from 'lodash' 5import { snakeCase } from 'lodash'
6import { objectConverter, parseBytes } from '../../helpers/core-utils'
7import validator from 'validator' 6import validator from 'validator'
7import { objectConverter, parseBytes } from '../../helpers/core-utils'
8 8
9const expect = chai.expect 9const expect = chai.expect
10 10
diff --git a/server/tests/helpers/image.ts b/server/tests/helpers/image.ts
index 54911697f..9fe9aa4cb 100644
--- a/server/tests/helpers/image.ts
+++ b/server/tests/helpers/image.ts
@@ -1,11 +1,11 @@
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 'mocha' 3import 'mocha'
4import { expect } from 'chai'
4import { readFile, remove } from 'fs-extra' 5import { readFile, remove } from 'fs-extra'
5import { join } from 'path' 6import { join } from 'path'
6import { processImage } from '../../../server/helpers/image-utils' 7import { processImage } from '../../../server/helpers/image-utils'
7import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils' 8import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils'
8import { expect } from 'chai'
9 9
10async function checkBuffers (path1: string, path2: string, equals: boolean) { 10async function checkBuffers (path1: string, path2: string, equals: boolean) {
11 const [ buf1, buf2 ] = await Promise.all([ 11 const [ buf1, buf2 ] = await Promise.all([
diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts
index 4d9c07f1a..4968eef08 100644
--- a/server/tests/misc-endpoints.ts
+++ b/server/tests/misc-endpoints.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 5import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
7import { VideoPrivacy } from '@shared/models' 6import { HttpStatusCode, VideoPrivacy } from '@shared/models'
8 7
9const expect = chai.expect 8const expect = chai.expect
10 9
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts
index b96de4e90..4c1bc7d06 100644
--- a/server/tests/plugins/action-hooks.ts
+++ b/server/tests/plugins/action-hooks.ts
@@ -120,7 +120,7 @@ describe('Test plugin action hooks', function () {
120 }) 120 })
121 121
122 it('Should run action:api.user.oauth2-got-token', async function () { 122 it('Should run action:api.user.oauth2-got-token', async function () {
123 await servers[0].login.getAccessToken('created_user', 'super_password') 123 await servers[0].login.login({ user: { username: 'created_user' } })
124 124
125 await checkHook('action:api.user.oauth2-got-token') 125 await checkHook('action:api.user.oauth2-got-token')
126 }) 126 })
diff --git a/server/tests/plugins/external-auth.ts b/server/tests/plugins/external-auth.ts
index a2828603a..f3e018d43 100644
--- a/server/tests/plugins/external-auth.ts
+++ b/server/tests/plugins/external-auth.ts
@@ -2,17 +2,16 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 decodeQueryString,
9 createSingleServer, 7 createSingleServer,
10 PluginsCommand, 8 decodeQueryString,
11 PeerTubeServer, 9 PeerTubeServer,
10 PluginsCommand,
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 wait 12 wait
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { UserRole } from '@shared/models' 14import { HttpStatusCode, UserRole } from '@shared/models'
16 15
17async function loginExternal (options: { 16async function loginExternal (options: {
18 server: PeerTubeServer 17 server: PeerTubeServer
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts
index ba84dd27a..c00ac8f91 100644
--- a/server/tests/plugins/filter-hooks.ts
+++ b/server/tests/plugins/filter-hooks.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createMultipleServers, 7 createMultipleServers,
@@ -15,7 +14,7 @@ import {
15 setDefaultVideoChannel, 14 setDefaultVideoChannel,
16 waitJobs 15 waitJobs
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
18import { VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' 17import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
19 18
20const expect = chai.expect 19const expect = chai.expect
21 20
diff --git a/server/tests/plugins/html-injection.ts b/server/tests/plugins/html-injection.ts
index 2902c39b7..95c0cd687 100644
--- a/server/tests/plugins/html-injection.ts
+++ b/server/tests/plugins/html-injection.ts
@@ -6,8 +6,8 @@ import {
6 cleanupTests, 6 cleanupTests,
7 createSingleServer, 7 createSingleServer,
8 makeHTMLRequest, 8 makeHTMLRequest,
9 PluginsCommand,
10 PeerTubeServer, 9 PeerTubeServer,
10 PluginsCommand,
11 setAccessTokensToServers 11 setAccessTokensToServers
12} from '../../../shared/extra-utils' 12} from '../../../shared/extra-utils'
13 13
diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts
index a73d76caa..fde0166f9 100644
--- a/server/tests/plugins/id-and-pass-auth.ts
+++ b/server/tests/plugins/id-and-pass-auth.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils'
6import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' 6import { HttpStatusCode, UserRole } from '@shared/models'
7import { UserRole } from '@shared/models'
8 7
9describe('Test id and pass auth plugins', function () { 8describe('Test id and pass auth plugins', function () {
10 let server: PeerTubeServer 9 let server: PeerTubeServer
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index 5cb664bda..242994273 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -2,19 +2,19 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 checkVideoFilesWereRemoved, 6 checkVideoFilesWereRemoved,
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
11 makeGetRequest, 10 makeGetRequest,
12 makePostBodyRequest, 11 makePostBodyRequest,
13 PluginsCommand,
14 PeerTubeServer, 12 PeerTubeServer,
13 PluginsCommand,
15 setAccessTokensToServers, 14 setAccessTokensToServers,
16 waitJobs 15 waitJobs
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
17import { HttpStatusCode } from '@shared/models'
18 18
19function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) { 19function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) {
20 const body = { command } 20 const body = { command }
diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.ts
index becb7c47b..b1ac9e2fe 100644
--- a/server/tests/plugins/plugin-router.ts
+++ b/server/tests/plugins/plugin-router.ts
@@ -2,16 +2,16 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
9 makeGetRequest, 8 makeGetRequest,
10 makePostBodyRequest, 9 makePostBodyRequest,
11 PluginsCommand,
12 PeerTubeServer, 10 PeerTubeServer,
11 PluginsCommand,
13 setAccessTokensToServers 12 setAccessTokensToServers
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
14import { HttpStatusCode } from '@shared/models'
15 15
16describe('Test plugin helpers', function () { 16describe('Test plugin helpers', function () {
17 let server: PeerTubeServer 17 let server: PeerTubeServer
diff --git a/server/tests/plugins/plugin-storage.ts b/server/tests/plugins/plugin-storage.ts
index 90dafa3e1..e20c36dba 100644
--- a/server/tests/plugins/plugin-storage.ts
+++ b/server/tests/plugins/plugin-storage.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { pathExists, readdir, readFile } from 'fs-extra' 5import { pathExists, readdir, readFile } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
@@ -13,6 +12,7 @@ import {
13 PluginsCommand, 12 PluginsCommand,
14 setAccessTokensToServers 13 setAccessTokensToServers
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { HttpStatusCode } from '@shared/models'
16 16
17describe('Test plugin storage', function () { 17describe('Test plugin storage', function () {
18 let server: PeerTubeServer 18 let server: PeerTubeServer
diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts
index 3c54d3796..0bf1fab01 100644
--- a/server/tests/plugins/plugin-transcoding.ts
+++ b/server/tests/plugins/plugin-transcoding.ts
@@ -7,8 +7,8 @@ import { getAudioStream, getVideoFileFPS, getVideoStreamFromFile } from '@server
7import { 7import {
8 cleanupTests, 8 cleanupTests,
9 createSingleServer, 9 createSingleServer,
10 PluginsCommand,
11 PeerTubeServer, 10 PeerTubeServer,
11 PluginsCommand,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultVideoChannel, 13 setDefaultVideoChannel,
14 testFfmpegStreamError, 14 testFfmpegStreamError,
diff --git a/server/tests/plugins/plugin-unloading.ts b/server/tests/plugins/plugin-unloading.ts
index faf9cc599..6bf2fda9b 100644
--- a/server/tests/plugins/plugin-unloading.ts
+++ b/server/tests/plugins/plugin-unloading.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -11,6 +10,7 @@ import {
11 PluginsCommand, 10 PluginsCommand,
12 setAccessTokensToServers 11 setAccessTokensToServers
13} from '@shared/extra-utils' 12} from '@shared/extra-utils'
13import { HttpStatusCode } from '@shared/models'
14 14
15describe('Test plugins module unloading', function () { 15describe('Test plugins module unloading', function () {
16 let server: PeerTubeServer = null 16 let server: PeerTubeServer = null
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts
index dd3b40225..f527a2b30 100644
--- a/server/tests/plugins/video-constants.ts
+++ b/server/tests/plugins/video-constants.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils'
6import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 6import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
7import { VideoPlaylistPrivacy } from '@shared/models'
8 7
9const expect = chai.expect 8const expect = chai.expect
10 9