diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/activitypub.ts | 4 | ||||
-rw-r--r-- | server/tests/api/check-params/services.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/video-comments.ts | 2 | ||||
-rw-r--r-- | server/tests/api/index-fast.ts | 18 | ||||
-rw-r--r-- | server/tests/api/index-slow.ts | 10 | ||||
-rw-r--r-- | server/tests/api/server/config.ts (renamed from server/tests/api/config.ts) | 2 | ||||
-rw-r--r-- | server/tests/api/server/follows.ts (renamed from server/tests/api/follows.ts) | 19 | ||||
-rw-r--r-- | server/tests/api/server/jobs.ts (renamed from server/tests/api/jobs.ts) | 12 | ||||
-rw-r--r-- | server/tests/api/users/users.ts (renamed from server/tests/api/users.ts) | 10 | ||||
-rw-r--r-- | server/tests/api/videos/multiple-servers.ts (renamed from server/tests/api/multiple-servers.ts) | 13 | ||||
-rw-r--r-- | server/tests/api/videos/services.ts (renamed from server/tests/api/services.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/single-server.ts (renamed from server/tests/api/single-server.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-abuse.ts (renamed from server/tests/api/video-abuse.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-blacklist-management.ts (renamed from server/tests/api/video-blacklist-management.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-blacklist.ts (renamed from server/tests/api/video-blacklist.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-channels.ts (renamed from server/tests/api/video-channels.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-comments.ts (renamed from server/tests/api/video-comments.ts) | 9 | ||||
-rw-r--r-- | server/tests/api/videos/video-description.ts (renamed from server/tests/api/video-description.ts) | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-privacy.ts (renamed from server/tests/api/video-privacy.ts) | 12 | ||||
-rw-r--r-- | server/tests/api/videos/video-transcoder.ts (renamed from server/tests/api/video-transcoder.ts) | 2 | ||||
-rw-r--r-- | server/tests/utils/cli/cli.ts (renamed from server/tests/utils/cli.ts) | 2 | ||||
-rw-r--r-- | server/tests/utils/index.ts | 30 | ||||
-rw-r--r-- | server/tests/utils/miscs/miscs.ts (renamed from server/tests/utils/miscs.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/requests/requests.ts (renamed from server/tests/utils/requests.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/server/activitypub.ts (renamed from server/tests/utils/activitypub.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/server/clients.ts (renamed from server/tests/utils/clients.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/server/config.ts (renamed from server/tests/utils/config.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/server/follows.ts (renamed from server/tests/utils/follows.ts) | 2 | ||||
-rw-r--r-- | server/tests/utils/server/jobs.ts (renamed from server/tests/utils/jobs.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/server/servers.ts (renamed from server/tests/utils/servers.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/users/login.ts (renamed from server/tests/utils/login.ts) | 2 | ||||
-rw-r--r-- | server/tests/utils/users/users.ts (renamed from server/tests/utils/users.ts) | 2 | ||||
-rw-r--r-- | server/tests/utils/videos/services.ts (renamed from server/tests/utils/services.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/videos/video-abuses.ts (renamed from server/tests/utils/video-abuses.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/videos/video-blacklist.ts (renamed from server/tests/utils/video-blacklist.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/videos/video-channels.ts (renamed from server/tests/utils/video-channels.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/videos/video-comments.ts (renamed from server/tests/utils/video-comments.ts) | 0 | ||||
-rw-r--r-- | server/tests/utils/videos/videos.ts (renamed from server/tests/utils/videos.ts) | 12 |
38 files changed, 98 insertions, 95 deletions
diff --git a/server/tests/activitypub.ts b/server/tests/activitypub.ts index 333e02e84..94615c63f 100644 --- a/server/tests/activitypub.ts +++ b/server/tests/activitypub.ts | |||
@@ -2,9 +2,7 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from './utils' | 5 | import { flushTests, killallServers, makeActivityPubGetRequest, runServer, ServerInfo, setAccessTokensToServers } from './utils' |
6 | import { runServer } from './utils/servers' | ||
7 | import { makeActivityPubGetRequest } from './utils/activitypub' | ||
8 | 6 | ||
9 | const expect = chai.expect | 7 | const expect = chai.expect |
10 | 8 | ||
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts index 780254df5..f82520574 100644 --- a/server/tests/api/check-params/services.ts +++ b/server/tests/api/check-params/services.ts | |||
@@ -9,7 +9,7 @@ import { | |||
9 | setAccessTokensToServers, | 9 | setAccessTokensToServers, |
10 | killallServers | 10 | killallServers |
11 | } from '../../utils' | 11 | } from '../../utils' |
12 | import { getVideosList, uploadVideo } from '../../utils/videos' | 12 | import { getVideosList, uploadVideo } from '../../utils/videos/videos' |
13 | 13 | ||
14 | describe('Test services API validators', function () { | 14 | describe('Test services API validators', function () { |
15 | let server | 15 | let server |
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index e8d7ddf38..f3832bd2c 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts | |||
@@ -3,7 +3,7 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as request from 'supertest' | 4 | import * as request from 'supertest' |
5 | import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' | 5 | import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' |
6 | import { addVideoCommentThread } from '../../utils/video-comments' | 6 | import { addVideoCommentThread } from '../../utils/videos/video-comments' |
7 | 7 | ||
8 | describe('Test video comments API validator', function () { | 8 | describe('Test video comments API validator', function () { |
9 | let pathThread: string | 9 | let pathThread: string |
diff --git a/server/tests/api/index-fast.ts b/server/tests/api/index-fast.ts index 35b414383..e591d0fd2 100644 --- a/server/tests/api/index-fast.ts +++ b/server/tests/api/index-fast.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | // Order of the tests we want to execute | 1 | // Order of the tests we want to execute |
2 | import './config' | 2 | import './server/config' |
3 | import './check-params' | 3 | import './check-params' |
4 | import './users' | 4 | import './users/users' |
5 | import './single-server' | 5 | import './videos/single-server' |
6 | import './video-abuse' | 6 | import './videos/video-abuse' |
7 | import './video-blacklist' | 7 | import './videos/video-blacklist' |
8 | import './video-blacklist-management' | 8 | import './videos/video-blacklist-management' |
9 | import './video-description' | 9 | import './videos/video-description' |
10 | import './video-privacy' | 10 | import './videos/video-privacy' |
11 | import './services' | 11 | import './videos/services' |
diff --git a/server/tests/api/index-slow.ts b/server/tests/api/index-slow.ts index b525d6f01..23b6526c7 100644 --- a/server/tests/api/index-slow.ts +++ b/server/tests/api/index-slow.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | // Order of the tests we want to execute | 1 | // Order of the tests we want to execute |
2 | // import './multiple-servers' | 2 | // import './multiple-servers' |
3 | import './video-transcoder' | 3 | import './videos/video-transcoder' |
4 | import './multiple-servers' | 4 | import './videos/multiple-servers' |
5 | import './follows' | 5 | import './server/follows' |
6 | import './jobs' | 6 | import './server/jobs' |
7 | import './video-comments' | 7 | import './videos/video-comments' |
diff --git a/server/tests/api/config.ts b/server/tests/api/server/config.ts index 61ae57977..e8846c8db 100644 --- a/server/tests/api/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -9,7 +9,7 @@ import { | |||
9 | flushTests, | 9 | flushTests, |
10 | runServer, | 10 | runServer, |
11 | registerUser | 11 | registerUser |
12 | } from '../utils' | 12 | } from '../../utils/index' |
13 | 13 | ||
14 | describe('Test config', function () { | 14 | describe('Test config', function () { |
15 | let server = null | 15 | let server = null |
diff --git a/server/tests/api/follows.ts b/server/tests/api/server/follows.ts index 2ffa426a0..f77c0c67c 100644 --- a/server/tests/api/follows.ts +++ b/server/tests/api/server/follows.ts | |||
@@ -2,18 +2,21 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' | 5 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' |
6 | 6 | ||
7 | import { | 7 | import { |
8 | flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, | 8 | flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, |
9 | wait | 9 | wait |
10 | } from '../utils' | 10 | } from '../../utils/index' |
11 | import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../utils/follows' | 11 | import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs' |
12 | import { getUserAccessToken } from '../utils/login' | 12 | import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows' |
13 | import { dateIsValid, webtorrentAdd } from '../utils/miscs' | 13 | import { getUserAccessToken } from '../../utils/users/login' |
14 | import { createUser } from '../utils/users' | 14 | import { createUser } from '../../utils/users/users' |
15 | import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' | 15 | import { |
16 | import { getVideo, rateVideo, testVideoImage } from '../utils/videos' | 16 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, |
17 | getVideoThreadComments | ||
18 | } from '../../utils/videos/video-comments' | ||
19 | import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos' | ||
17 | 20 | ||
18 | const expect = chai.expect | 21 | const expect = chai.expect |
19 | 22 | ||
diff --git a/server/tests/api/jobs.ts b/server/tests/api/server/jobs.ts index 4d9b61392..2e17e71a4 100644 --- a/server/tests/api/jobs.ts +++ b/server/tests/api/server/jobs.ts | |||
@@ -2,12 +2,12 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../utils' | 5 | import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../../utils/index' |
6 | import { doubleFollow } from '../utils/follows' | 6 | import { doubleFollow } from '../../utils/server/follows' |
7 | import { getJobsList, getJobsListPaginationAndSort } from '../utils/jobs' | 7 | import { getJobsList, getJobsListPaginationAndSort } from '../../utils/server/jobs' |
8 | import { flushAndRunMultipleServers } from '../utils/servers' | 8 | import { flushAndRunMultipleServers } from '../../utils/server/servers' |
9 | import { uploadVideo } from '../utils/videos' | 9 | import { uploadVideo } from '../../utils/videos/videos' |
10 | import { dateIsValid } from '../utils/miscs' | 10 | import { dateIsValid } from '../../utils/miscs/miscs' |
11 | 11 | ||
12 | const expect = chai.expect | 12 | const expect = chai.expect |
13 | 13 | ||
diff --git a/server/tests/api/users.ts b/server/tests/api/users/users.ts index 67e4cc8c6..2e3a0b94f 100644 --- a/server/tests/api/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { UserRole } from '../../../shared' | 5 | import { UserRole } from '../../../../shared/index' |
6 | import { | 6 | import { |
7 | createUser, | 7 | createUser, |
8 | flushTests, | 8 | flushTests, |
@@ -26,10 +26,10 @@ import { | |||
26 | updateMyUser, | 26 | updateMyUser, |
27 | updateUser, | 27 | updateUser, |
28 | uploadVideo | 28 | uploadVideo |
29 | } from '../utils' | 29 | } from '../../utils/index' |
30 | import { follow } from '../utils/follows' | 30 | import { follow } from '../../utils/server/follows' |
31 | import { getMyVideos } from '../utils/videos' | 31 | import { getMyVideos } from '../../utils/videos/videos' |
32 | import { setAccessTokensToServers } from '../utils/login' | 32 | import { setAccessTokensToServers } from '../../utils/users/login' |
33 | 33 | ||
34 | const expect = chai.expect | 34 | const expect = chai.expect |
35 | 35 | ||
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 06274d4cc..84f730a8e 100644 --- a/server/tests/api/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -4,16 +4,19 @@ import * as chai from 'chai' | |||
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import * as request from 'supertest' | 6 | import * as request from 'supertest' |
7 | import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' | 7 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' |
8 | 8 | ||
9 | import { | 9 | import { |
10 | addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo, | 10 | addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo, |
11 | getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage, | 11 | getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage, |
12 | updateVideo, uploadVideo, wait, webtorrentAdd | 12 | updateVideo, uploadVideo, wait, webtorrentAdd |
13 | } from '../utils' | 13 | } from '../../utils/index' |
14 | import { createUser } from '../utils/users' | 14 | import { createUser } from '../../utils/users/users' |
15 | import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' | 15 | import { |
16 | import { viewVideo } from '../utils/videos' | 16 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, |
17 | getVideoThreadComments | ||
18 | } from '../../utils/videos/video-comments' | ||
19 | import { viewVideo } from '../../utils/videos/videos' | ||
17 | 20 | ||
18 | const expect = chai.expect | 21 | const expect = chai.expect |
19 | 22 | ||
diff --git a/server/tests/api/services.ts b/server/tests/api/videos/services.ts index 4d480c305..1cda464d9 100644 --- a/server/tests/api/services.ts +++ b/server/tests/api/videos/services.ts | |||
@@ -12,8 +12,8 @@ import { | |||
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | killallServers, | 13 | killallServers, |
14 | getOEmbed | 14 | getOEmbed |
15 | } from '../utils' | 15 | } from '../../utils/index' |
16 | import { runServer } from '../utils/servers' | 16 | import { runServer } from '../../utils/server/servers' |
17 | 17 | ||
18 | describe('Test services', function () { | 18 | describe('Test services', function () { |
19 | let server: ServerInfo = null | 19 | let server: ServerInfo = null |
diff --git a/server/tests/api/single-server.ts b/server/tests/api/videos/single-server.ts index 7f4351f5e..02723654d 100644 --- a/server/tests/api/single-server.ts +++ b/server/tests/api/videos/single-server.ts | |||
@@ -30,8 +30,8 @@ import { | |||
30 | uploadVideo, | 30 | uploadVideo, |
31 | wait, | 31 | wait, |
32 | webtorrentAdd | 32 | webtorrentAdd |
33 | } from '../utils' | 33 | } from '../../utils/index' |
34 | import { viewVideo } from '../utils/videos' | 34 | import { viewVideo } from '../../utils/videos/videos' |
35 | 35 | ||
36 | const expect = chai.expect | 36 | const expect = chai.expect |
37 | 37 | ||
diff --git a/server/tests/api/video-abuse.ts b/server/tests/api/videos/video-abuse.ts index 4a0b6b504..3fcf5d8c7 100644 --- a/server/tests/api/video-abuse.ts +++ b/server/tests/api/videos/video-abuse.ts | |||
@@ -13,8 +13,8 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | uploadVideo, | 14 | uploadVideo, |
15 | wait | 15 | wait |
16 | } from '../utils' | 16 | } from '../../utils/index' |
17 | import { doubleFollow } from '../utils/follows' | 17 | import { doubleFollow } from '../../utils/server/follows' |
18 | 18 | ||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
diff --git a/server/tests/api/video-blacklist-management.ts b/server/tests/api/videos/video-blacklist-management.ts index 0c636e094..db79784c2 100644 --- a/server/tests/api/video-blacklist-management.ts +++ b/server/tests/api/videos/video-blacklist-management.ts | |||
@@ -16,8 +16,8 @@ import { | |||
16 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
17 | uploadVideo, | 17 | uploadVideo, |
18 | wait | 18 | wait |
19 | } from '../utils' | 19 | } from '../../utils/index' |
20 | import { doubleFollow } from '../utils/follows' | 20 | import { doubleFollow } from '../../utils/server/follows' |
21 | 21 | ||
22 | const expect = chai.expect | 22 | const expect = chai.expect |
23 | const orderBy = lodash.orderBy | 23 | const orderBy = lodash.orderBy |
diff --git a/server/tests/api/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts index 3afd8c510..d1cefa5d7 100644 --- a/server/tests/api/video-blacklist.ts +++ b/server/tests/api/videos/video-blacklist.ts | |||
@@ -13,8 +13,8 @@ import { | |||
13 | setAccessTokensToServers, | 13 | setAccessTokensToServers, |
14 | uploadVideo, | 14 | uploadVideo, |
15 | wait | 15 | wait |
16 | } from '../utils' | 16 | } from '../../utils/index' |
17 | import { doubleFollow } from '../utils/follows' | 17 | import { doubleFollow } from '../../utils/server/follows' |
18 | 18 | ||
19 | const expect = chai.expect | 19 | const expect = chai.expect |
20 | 20 | ||
diff --git a/server/tests/api/video-channels.ts b/server/tests/api/videos/video-channels.ts index 2d8efb320..454a96da6 100644 --- a/server/tests/api/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -17,8 +17,8 @@ import { | |||
17 | updateVideoChannel, | 17 | updateVideoChannel, |
18 | deleteVideoChannel, | 18 | deleteVideoChannel, |
19 | getVideoChannel | 19 | getVideoChannel |
20 | } from '../utils' | 20 | } from '../../utils/index' |
21 | import { User } from '../../../shared' | 21 | import { User } from '../../../../shared/index' |
22 | 22 | ||
23 | describe('Test a video channels', function () { | 23 | describe('Test a video channels', function () { |
24 | let server: ServerInfo | 24 | let server: ServerInfo |
diff --git a/server/tests/api/video-comments.ts b/server/tests/api/videos/video-comments.ts index f05ca5e81..3b6578f04 100644 --- a/server/tests/api/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts | |||
@@ -2,9 +2,12 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' | 5 | import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model' |
6 | import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../utils' | 6 | import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index' |
7 | import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' | 7 | import { |
8 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, | ||
9 | getVideoThreadComments | ||
10 | } from '../../utils/videos/video-comments' | ||
8 | 11 | ||
9 | const expect = chai.expect | 12 | const expect = chai.expect |
10 | 13 | ||
diff --git a/server/tests/api/video-description.ts b/server/tests/api/videos/video-description.ts index 7ad1c63ae..c2985194c 100644 --- a/server/tests/api/video-description.ts +++ b/server/tests/api/videos/video-description.ts | |||
@@ -14,8 +14,8 @@ import { | |||
14 | updateVideo, | 14 | updateVideo, |
15 | uploadVideo, | 15 | uploadVideo, |
16 | wait | 16 | wait |
17 | } from '../utils' | 17 | } from '../../utils/index' |
18 | import { doubleFollow } from '../utils/follows' | 18 | import { doubleFollow } from '../../utils/server/follows' |
19 | 19 | ||
20 | const expect = chai.expect | 20 | const expect = chai.expect |
21 | 21 | ||
diff --git a/server/tests/api/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index 26847efce..de709f8f1 100644 --- a/server/tests/api/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum' | 5 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' |
6 | import { | 6 | import { |
7 | flushAndRunMultipleServers, | 7 | flushAndRunMultipleServers, |
8 | flushTests, | 8 | flushTests, |
@@ -12,11 +12,11 @@ import { | |||
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | uploadVideo, | 13 | uploadVideo, |
14 | wait | 14 | wait |
15 | } from '../utils' | 15 | } from '../../utils/index' |
16 | import { doubleFollow } from '../utils/follows' | 16 | import { doubleFollow } from '../../utils/server/follows' |
17 | import { getUserAccessToken } from '../utils/login' | 17 | import { getUserAccessToken } from '../../utils/users/login' |
18 | import { createUser } from '../utils/users' | 18 | import { createUser } from '../../utils/users/users' |
19 | import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos' | 19 | import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos' |
20 | 20 | ||
21 | const expect = chai.expect | 21 | const expect = chai.expect |
22 | 22 | ||
diff --git a/server/tests/api/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 9a6e91b76..27927a594 100644 --- a/server/tests/api/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts | |||
@@ -15,7 +15,7 @@ import { | |||
15 | killallServers, | 15 | killallServers, |
16 | webtorrentAdd, | 16 | webtorrentAdd, |
17 | getVideo | 17 | getVideo |
18 | } from '../utils' | 18 | } from '../../utils/index' |
19 | 19 | ||
20 | describe('Test video transcoding', function () { | 20 | describe('Test video transcoding', function () { |
21 | let servers: ServerInfo[] = [] | 21 | let servers: ServerInfo[] = [] |
diff --git a/server/tests/utils/cli.ts b/server/tests/utils/cli/cli.ts index 4098fdf6f..54d05e9c6 100644 --- a/server/tests/utils/cli.ts +++ b/server/tests/utils/cli/cli.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { exec } from 'child_process' | 1 | import { exec } from 'child_process' |
2 | 2 | ||
3 | import { ServerInfo } from './servers' | 3 | import { ServerInfo } from '../server/servers' |
4 | 4 | ||
5 | function getEnvCli (server?: ServerInfo) { | 5 | function getEnvCli (server?: ServerInfo) { |
6 | return `NODE_ENV=test NODE_APP_INSTANCE=${server.serverNumber}` | 6 | return `NODE_ENV=test NODE_APP_INSTANCE=${server.serverNumber}` |
diff --git a/server/tests/utils/index.ts b/server/tests/utils/index.ts index b918ee83d..d7789e517 100644 --- a/server/tests/utils/index.ts +++ b/server/tests/utils/index.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | export * from './activitypub' | 1 | export * from './server/activitypub' |
2 | export * from './cli' | 2 | export * from './cli/cli' |
3 | export * from './clients' | 3 | export * from './server/clients' |
4 | export * from './config' | 4 | export * from './server/config' |
5 | export * from './login' | 5 | export * from './users/login' |
6 | export * from './miscs' | 6 | export * from './miscs/miscs' |
7 | export * from './follows' | 7 | export * from './server/follows' |
8 | export * from './requests' | 8 | export * from './requests/requests' |
9 | export * from './servers' | 9 | export * from './server/servers' |
10 | export * from './services' | 10 | export * from './videos/services' |
11 | export * from './users' | 11 | export * from './users/users' |
12 | export * from './video-abuses' | 12 | export * from './videos/video-abuses' |
13 | export * from './video-blacklist' | 13 | export * from './videos/video-blacklist' |
14 | export * from './video-channels' | 14 | export * from './videos/video-channels' |
15 | export * from './videos' | 15 | export * from './videos/videos' |
diff --git a/server/tests/utils/miscs.ts b/server/tests/utils/miscs/miscs.ts index 424b0db98..424b0db98 100644 --- a/server/tests/utils/miscs.ts +++ b/server/tests/utils/miscs/miscs.ts | |||
diff --git a/server/tests/utils/requests.ts b/server/tests/utils/requests/requests.ts index 52b7a4c29..52b7a4c29 100644 --- a/server/tests/utils/requests.ts +++ b/server/tests/utils/requests/requests.ts | |||
diff --git a/server/tests/utils/activitypub.ts b/server/tests/utils/server/activitypub.ts index cf3c1c3b3..cf3c1c3b3 100644 --- a/server/tests/utils/activitypub.ts +++ b/server/tests/utils/server/activitypub.ts | |||
diff --git a/server/tests/utils/clients.ts b/server/tests/utils/server/clients.ts index a8c5b51c5..a8c5b51c5 100644 --- a/server/tests/utils/clients.ts +++ b/server/tests/utils/server/clients.ts | |||
diff --git a/server/tests/utils/config.ts b/server/tests/utils/server/config.ts index d09c19c60..d09c19c60 100644 --- a/server/tests/utils/config.ts +++ b/server/tests/utils/server/config.ts | |||
diff --git a/server/tests/utils/follows.ts b/server/tests/utils/server/follows.ts index a9f798bcb..82e89175c 100644 --- a/server/tests/utils/follows.ts +++ b/server/tests/utils/server/follows.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { wait } from './miscs' | 2 | import { wait } from '../miscs/miscs' |
3 | import { ServerInfo } from './servers' | 3 | import { ServerInfo } from './servers' |
4 | 4 | ||
5 | function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string) { | 5 | function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string) { |
diff --git a/server/tests/utils/jobs.ts b/server/tests/utils/server/jobs.ts index 0a8c51575..0a8c51575 100644 --- a/server/tests/utils/jobs.ts +++ b/server/tests/utils/server/jobs.ts | |||
diff --git a/server/tests/utils/servers.ts b/server/tests/utils/server/servers.ts index 8340fbc18..8340fbc18 100644 --- a/server/tests/utils/servers.ts +++ b/server/tests/utils/server/servers.ts | |||
diff --git a/server/tests/utils/login.ts b/server/tests/utils/users/login.ts index 22d37c46f..855c4828d 100644 --- a/server/tests/utils/login.ts +++ b/server/tests/utils/users/login.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | 2 | ||
3 | import { ServerInfo } from './servers' | 3 | import { ServerInfo } from '../server/servers' |
4 | 4 | ||
5 | type Client = { id: string, secret: string } | 5 | type Client = { id: string, secret: string } |
6 | type User = { username: string, password: string } | 6 | type User = { username: string, password: string } |
diff --git a/server/tests/utils/users.ts b/server/tests/utils/users/users.ts index a37d84ab4..bd8d7ab04 100644 --- a/server/tests/utils/users.ts +++ b/server/tests/utils/users/users.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | 2 | ||
3 | import { UserRole } from '../../../shared' | 3 | import { UserRole } from '../../../../shared/index' |
4 | 4 | ||
5 | function createUser ( | 5 | function createUser ( |
6 | url: string, | 6 | url: string, |
diff --git a/server/tests/utils/services.ts b/server/tests/utils/videos/services.ts index 1a53dd4cf..1a53dd4cf 100644 --- a/server/tests/utils/services.ts +++ b/server/tests/utils/videos/services.ts | |||
diff --git a/server/tests/utils/video-abuses.ts b/server/tests/utils/videos/video-abuses.ts index f00809234..f00809234 100644 --- a/server/tests/utils/video-abuses.ts +++ b/server/tests/utils/videos/video-abuses.ts | |||
diff --git a/server/tests/utils/video-blacklist.ts b/server/tests/utils/videos/video-blacklist.ts index 3a499f46a..3a499f46a 100644 --- a/server/tests/utils/video-blacklist.ts +++ b/server/tests/utils/videos/video-blacklist.ts | |||
diff --git a/server/tests/utils/video-channels.ts b/server/tests/utils/videos/video-channels.ts index 0fb80d331..0fb80d331 100644 --- a/server/tests/utils/video-channels.ts +++ b/server/tests/utils/videos/video-channels.ts | |||
diff --git a/server/tests/utils/video-comments.ts b/server/tests/utils/videos/video-comments.ts index 878147049..878147049 100644 --- a/server/tests/utils/video-comments.ts +++ b/server/tests/utils/videos/video-comments.ts | |||
diff --git a/server/tests/utils/videos.ts b/server/tests/utils/videos/videos.ts index fb758cf29..6de1b8c92 100644 --- a/server/tests/utils/videos.ts +++ b/server/tests/utils/videos/videos.ts | |||
@@ -1,13 +1,9 @@ | |||
1 | import { readFile } from 'fs' | 1 | import { readFile } from 'fs' |
2 | import * as request from 'supertest' | ||
3 | import { join, isAbsolute } from 'path' | ||
4 | import * as parseTorrent from 'parse-torrent' | 2 | import * as parseTorrent from 'parse-torrent' |
5 | 3 | import { isAbsolute, join } from 'path' | |
6 | import { makeGetRequest } from './requests' | 4 | import * as request from 'supertest' |
7 | import { readFilePromise } from './miscs' | 5 | import { getMyUserInformation, makeGetRequest, readFilePromise, ServerInfo } from '../' |
8 | import { ServerInfo } from './servers' | 6 | import { VideoPrivacy } from '../../../../shared/models/videos' |
9 | import { getMyUserInformation } from './users' | ||
10 | import { VideoPrivacy } from '../../../shared' | ||
11 | 7 | ||
12 | type VideoAttributes = { | 8 | type VideoAttributes = { |
13 | name?: string | 9 | name?: string |