diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 14:27:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:19 +0200 |
commit | 4c7e60bc17ee5830399bac4aa273356903421b4c (patch) | |
tree | 9e67397cf49b229b5bc0f9747f1a7e387bba558a /server/tests | |
parent | c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (diff) | |
download | PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.tar.gz PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.tar.zst PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.zip |
Reorganize imports
Diffstat (limited to 'server/tests')
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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
15 | import { VideoPlaylistPrivacy } from '@shared/models' | 14 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
16 | 15 | ||
17 | const expect = chai.expect | 16 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 5 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | 6 | ||
7 | const expect = chai.expect | 7 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
16 | import { VideoPlaylistPrivacy } from '@shared/models' | 15 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
17 | 16 | ||
18 | describe('Test AP refresher', function () { | 17 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
19 | import { AbuseCreate, AbuseState } from '@shared/models' | 18 | import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models' |
20 | 19 | ||
21 | describe('Test abuses API validators', function () { | 20 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
12 | import { HttpStatusCode } from '@shared/models' | ||
13 | 13 | ||
14 | describe('Test accounts API validators', function () { | 14 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
15 | import { CustomConfig } from '@shared/models' | 14 | import { CustomConfig, HttpStatusCode } from '@shared/models' |
16 | 15 | ||
17 | describe('Test config API validators', function () { | 16 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils' | 4 | import { cleanupTests, createSingleServer, killallServers, MockSmtpServer, PeerTubeServer } from '@shared/extra-utils' |
6 | import { ContactFormCommand } from '@shared/extra-utils/server' | 5 | import { ContactFormCommand } from '@shared/extra-utils/server' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | 7 | ||
8 | describe('Test contact form API validators', function () { | 8 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
18 | import { VideoCreateResult, VideoPrivacy } from '@shared/models' | 17 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' |
19 | 18 | ||
20 | describe('Test video lives API validator', function () { | 19 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
17 | import { PeerTubePlugin, PluginType } from '@shared/models' | 16 | import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models' |
18 | 17 | ||
19 | describe('Test server plugins API validators', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
14 | import { HttpStatusCode } from '@shared/models' | ||
15 | 15 | ||
16 | function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) { | 16 | function 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
13 | import { VideoPlaylistPrivacy } from '@shared/models' | 12 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
14 | 13 | ||
15 | describe('Test services API validators', function () { | 14 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { io } from 'socket.io-client' | 4 | import { io } from 'socket.io-client' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
19 | import { UserNotificationSetting, UserNotificationSettingValue } from '@shared/models' | 18 | import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models' |
20 | 19 | ||
21 | describe('Test user notifications API validators', function () { | 20 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
23 | import { UserAdminFlag, UserRole, VideoCreateResult } from '@shared/models' | 22 | import { HttpStatusCode, UserAdminFlag, UserRole, VideoCreateResult } from '@shared/models' |
24 | 23 | ||
25 | describe('Test users API validators', function () { | 24 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
20 | import { VideoBlacklistType } from '@shared/models' | 19 | import { HttpStatusCode, VideoBlacklistType } from '@shared/models' |
21 | 20 | ||
22 | describe('Test video blacklist API validators', function () { | 21 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
15 | import { VideoCreateResult } from '@shared/models' | 14 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' |
16 | 15 | ||
17 | describe('Test video captions API validator', function () { | 16 | describe('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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { omit } from 'lodash' | 5 | import { omit } from 'lodash' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | import { | 6 | import { |
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' |
22 | import { VideoChannelUpdate } from '@shared/models' | 21 | import { HttpStatusCode, VideoChannelUpdate } from '@shared/models' |
23 | 22 | ||
24 | const expect = chai.expect | 23 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
18 | import { VideoCreateResult } from '@shared/models' | 17 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' |
19 | 18 | ||
20 | const expect = chai.expect | 19 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
20 | import { VideoPrivacy } from '@shared/models' | 19 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
21 | 20 | ||
22 | describe('Test video imports API validator', function () { | 21 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
17 | import { | 16 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
13 | import { UserRole } from '@shared/models' | 12 | import { HttpStatusCode, UserRole } from '@shared/models' |
14 | 13 | ||
15 | async function testEndpoints (server: PeerTubeServer, token: string, filter: string, expectedStatus: HttpStatusCode) { | 14 | async 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { | 4 | import { |
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' |
15 | import { HttpStatusCode } from '@shared/models' | ||
16 | 16 | ||
17 | describe('Test videos history API validator', function () { | 17 | describe('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' | |||
6 | import { | 6 | import { |
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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { FfmpegCommand } from 'fluent-ffmpeg' | 5 | import { FfmpegCommand } from 'fluent-ffmpeg' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | import { | 6 | import { |
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' |
21 | import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' | 20 | import { HttpStatusCode, LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' |
22 | 21 | ||
23 | const expect = chai.expect | 22 | const 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' | |||
5 | import { VideoPrivacy, VideoState } from '@shared/models' | 5 | import { VideoPrivacy, VideoState } from '@shared/models' |
6 | import { | 6 | import { |
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' | |||
6 | import { VideoPrivacy } from '@shared/models' | 6 | import { VideoPrivacy } from '@shared/models' |
7 | import { | 7 | import { |
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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils' | 6 | import { ffprobePromise, getVideoStreamFromFile } from '@server/helpers/ffprobe-utils' |
7 | import { HttpStatusCode } from '@shared/models' | ||
8 | import { | 7 | import { |
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' |
29 | import { LiveVideo, LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' | 28 | import { |
29 | HttpStatusCode, | ||
30 | LiveVideo, | ||
31 | LiveVideoCreate, | ||
32 | VideoDetails, | ||
33 | VideoPrivacy, | ||
34 | VideoState, | ||
35 | VideoStreamingPlaylistType | ||
36 | } from '@shared/models' | ||
30 | 37 | ||
31 | const expect = chai.expect | 38 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 5 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | import { UserNotificationType } from '@shared/models' | 6 | import { UserNotificationType } from '@shared/models' |
7 | 7 | ||
8 | const expect = chai.expect | 8 | const 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' |
16 | import { PluginType, UserNotification, UserNotificationType } from '@shared/models' | 16 | import { 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' |
15 | import { UserNotification } from '@shared/models' | 15 | import { 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' |
15 | import { UserNotification, UserNotificationSettingValue } from '@shared/models' | 15 | import { 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { | 5 | import { 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' | ||
13 | import { VideoPrivacy } from '@shared/models' | 6 | import { VideoPrivacy } from '@shared/models' |
14 | 7 | ||
15 | describe('Test redundancy constraints', function () { | 8 | describe('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' | |||
5 | import { readdir } from 'fs-extra' | 5 | import { readdir } from 'fs-extra' |
6 | import * as magnetUtil from 'magnet-uri' | 6 | import * as magnetUtil from 'magnet-uri' |
7 | import { join } from 'path' | 7 | import { join } from 'path' |
8 | import { HttpStatusCode } from '@shared/models' | ||
9 | import { | 8 | import { |
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' |
23 | import { VideoPrivacy, VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '@shared/models' | 22 | import { HttpStatusCode, VideoPrivacy, VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '@shared/models' |
24 | 23 | ||
25 | const expect = chai.expect | 24 | const 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' | |||
5 | import { | 5 | import { |
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' | |||
5 | import { | 5 | import { |
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' | |||
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, createSingleServer, SearchCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' | 5 | import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/extra-utils' |
6 | import { VideoChannel } from '@shared/models' | 6 | import { VideoChannel } from '@shared/models' |
7 | 7 | ||
8 | const expect = chai.expect | 8 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, createSingleServer, SearchCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' | 5 | import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/extra-utils' |
6 | import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models' | 6 | import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models' |
7 | 7 | ||
8 | const expect = chai.expect | 8 | const 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' | |||
5 | import { | 5 | import { |
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' | |||
5 | import { | 5 | import { |
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' | |||
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
15 | import { CustomConfig } from '@shared/models' | 14 | import { CustomConfig, HttpStatusCode } from '@shared/models' |
16 | 15 | ||
17 | const expect = chai.expect | 16 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
15 | import { HttpStatusCode } from '@shared/models' | ||
16 | 16 | ||
17 | const expect = chai.expect | 17 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 5 | import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | 7 | ||
8 | const expect = chai.expect | 8 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' |
6 | import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' | 6 | import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' |
7 | import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' | ||
8 | 7 | ||
9 | const expect = chai.expect | 8 | const 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' | |||
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
17 | import { JobState, VideoCreateResult, VideoPrivacy } from '@shared/models' | 16 | import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models' |
18 | 17 | ||
19 | const expect = chai.expect | 18 | const 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' | |||
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { | 6 | import { |
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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
16 | import { PluginType } from '@shared/models' | 15 | import { HttpStatusCode, PluginType } from '@shared/models' |
17 | 16 | ||
18 | const expect = chai.expect | 17 | const 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 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import { HttpStatusCode } from '@shared/models' | ||
5 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' | 4 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | 6 | ||
7 | describe('Test application behind a reverse proxy', function () { | 7 | describe('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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 5 | import { cleanupTests, createSingleServer, MockSmtpServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | 7 | ||
8 | const expect = chai.expect | 8 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
16 | import { AbuseState, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models' | 15 | import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, Video, VideoPlaylistType } from '@shared/models' |
17 | 16 | ||
18 | const expect = chai.expect | 17 | const 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' | 6 | import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' |
7 | import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 7 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
8 | 8 | ||
9 | const expect = chai.expect | 9 | const 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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import * as request from 'supertest' | 5 | import * as request from 'supertest' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | import { | 6 | import { |
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' |
23 | import { VideoCommentThreadTree, VideoPrivacy } from '@shared/models' | 22 | import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models' |
24 | 23 | ||
25 | const expect = chai.expect | 24 | const 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { pathExists, readdir, stat } from 'fs-extra' | 5 | import { pathExists, readdir, stat } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { HttpStatusCode } from '@shared/models' | ||
8 | import { | 7 | import { |
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' |
16 | import { VideoPrivacy } from '@shared/models' | 15 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
17 | 16 | ||
18 | const expect = chai.expect | 17 | const 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' | |||
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
17 | import { VideoPrivacy } from '@shared/models' | 16 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
18 | 17 | ||
19 | const expect = chai.expect | 18 | const 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' | |||
6 | import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' | 6 | import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' |
7 | import { | 7 | import { |
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' | |||
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 5 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | 6 | ||
7 | const expect = chai.expect | 7 | const 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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | import { | 6 | import { |
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' |
21 | import { VideoStreamingPlaylistType } from '@shared/models' | 20 | import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models' |
22 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' | 21 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' |
23 | 22 | ||
24 | const expect = chai.expect | 23 | const 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
19 | import { | 18 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | import { cleanupTests, doubleFollow, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 6 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' |
7 | import { VideoCreateResult, VideoPrivacy } from '@shared/models' | ||
8 | 7 | ||
9 | const expect = chai.expect | 8 | const 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { omit } from 'lodash' | 5 | import { omit } from 'lodash' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { HttpStatusCode } from '@shared/models' | ||
8 | import { | 7 | import { |
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' |
21 | import { getMaxBitrate, VideoResolution, VideoState } from '@shared/models' | 20 | import { getMaxBitrate, HttpStatusCode, VideoResolution, VideoState } from '@shared/models' |
22 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' | 21 | import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' |
23 | import { | 22 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
14 | import { UserRole, Video, VideoPrivacy } from '@shared/models' | 13 | import { HttpStatusCode, UserRole, Video, VideoPrivacy } from '@shared/models' |
15 | 14 | ||
16 | async function getVideosNames (server: PeerTubeServer, token: string, filter: string, expectedStatus = HttpStatusCode.OK_200) { | 15 | async 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
15 | import { Video } from '@shared/models' | 14 | import { HttpStatusCode, Video } from '@shared/models' |
16 | 15 | ||
17 | const expect = chai.expect | 16 | const 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | 5 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' |
6 | import { VideoFile } from '@shared/models' | 6 | import { VideoFile } from '@shared/models' |
7 | 7 | ||
8 | const expect = chai.expect | 8 | const 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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
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' | |||
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { | 6 | import { |
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' | |||
5 | import { createFile, readdir } from 'fs-extra' | 5 | import { createFile, readdir } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { buildUUID } from '@server/helpers/uuid' | 7 | import { buildUUID } from '@server/helpers/uuid' |
8 | import { HttpStatusCode } from '@shared/models' | ||
9 | import { | 8 | import { |
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' |
22 | import { VideoPlaylistPrivacy } from '@shared/models' | 21 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
23 | 22 | ||
24 | const expect = chai.expect | 23 | const 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' | |||
2 | import { expect } from 'chai' | 2 | import { expect } from 'chai' |
3 | import { writeFile } from 'fs-extra' | 3 | import { writeFile } from 'fs-extra' |
4 | import { basename, join } from 'path' | 4 | import { basename, join } from 'path' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode, Video } from '@shared/models' |
6 | import { Video } from '@shared/models' | ||
7 | import { | 6 | import { |
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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { omit } from 'lodash' | 5 | import { omit } from 'lodash' |
6 | import { HttpStatusCode } from '@shared/models' | 6 | import { Account, HTMLServerConfig, HttpStatusCode, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy } from '@shared/models' |
7 | import { Account, HTMLServerConfig, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy } from '@shared/models' | ||
8 | import { | 7 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' | 5 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | 7 | ||
8 | describe('Official plugin auth-ldap', function () { | 8 | describe('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' | |||
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { | 5 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
16 | import { HttpStatusCode } from '@shared/models' | ||
17 | 17 | ||
18 | describe('Official plugin auto-mute', function () { | 18 | describe('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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import * as xmlParser from 'fast-xml-parser' | 5 | import * as xmlParser from 'fast-xml-parser' |
6 | import { HttpStatusCode } from '@shared/models' | ||
7 | import { | 6 | import { |
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' |
16 | import { VideoPrivacy } from '@shared/models' | 15 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
17 | 16 | ||
18 | chai.use(require('chai-xml')) | 17 | chai.use(require('chai-xml')) |
19 | chai.use(require('chai-json-schema')) | 18 | chai.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 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { VideoCommentModel } from '../../models/video/video-comment' | 5 | import { VideoCommentModel } from '../../models/video/video-comment' |
6 | 6 | ||
7 | const expect = chai.expect | 7 | const 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 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { snakeCase } from 'lodash' | 5 | import { snakeCase } from 'lodash' |
6 | import { objectConverter, parseBytes } from '../../helpers/core-utils' | ||
7 | import validator from 'validator' | 6 | import validator from 'validator' |
7 | import { objectConverter, parseBytes } from '../../helpers/core-utils' | ||
8 | 8 | ||
9 | const expect = chai.expect | 9 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | ||
4 | import { readFile, remove } from 'fs-extra' | 5 | import { readFile, remove } from 'fs-extra' |
5 | import { join } from 'path' | 6 | import { join } from 'path' |
6 | import { processImage } from '../../../server/helpers/image-utils' | 7 | import { processImage } from '../../../server/helpers/image-utils' |
7 | import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils' | 8 | import { buildAbsoluteFixturePath, root } from '../../../shared/extra-utils' |
8 | import { expect } from 'chai' | ||
9 | 9 | ||
10 | async function checkBuffers (path1: string, path2: string, equals: boolean) { | 10 | async 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' | 5 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' |
7 | import { VideoPrivacy } from '@shared/models' | 6 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
8 | 7 | ||
9 | const expect = chai.expect | 8 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
15 | import { UserRole } from '@shared/models' | 14 | import { HttpStatusCode, UserRole } from '@shared/models' |
16 | 15 | ||
17 | async function loginExternal (options: { | 16 | async 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
18 | import { VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' | 17 | import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' |
19 | 18 | ||
20 | const expect = chai.expect | 19 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils' |
6 | import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' | 6 | import { HttpStatusCode, UserRole } from '@shared/models' |
7 | import { UserRole } from '@shared/models' | ||
8 | 7 | ||
9 | describe('Test id and pass auth plugins', function () { | 8 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
17 | import { HttpStatusCode } from '@shared/models' | ||
18 | 18 | ||
19 | function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) { | 19 | function 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
14 | import { HttpStatusCode } from '@shared/models' | ||
15 | 15 | ||
16 | describe('Test plugin helpers', function () { | 16 | describe('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' | |||
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { pathExists, readdir, readFile } from 'fs-extra' | 5 | import { pathExists, readdir, readFile } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { HttpStatusCode } from '@shared/models' | ||
8 | import { | 7 | import { |
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' |
15 | import { HttpStatusCode } from '@shared/models' | ||
16 | 16 | ||
17 | describe('Test plugin storage', function () { | 17 | describe('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 | |||
7 | import { | 7 | import { |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | ||
6 | import { | 5 | import { |
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' |
13 | import { HttpStatusCode } from '@shared/models' | ||
14 | 14 | ||
15 | describe('Test plugins module unloading', function () { | 15 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils' |
6 | import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' | 6 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
7 | import { VideoPlaylistPrivacy } from '@shared/models' | ||
8 | 7 | ||
9 | const expect = chai.expect | 8 | const expect = chai.expect |
10 | 9 | ||