aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/travis.sh15
-rw-r--r--server/helpers/ffmpeg-utils.ts2
-rw-r--r--server/lib/user.ts6
-rw-r--r--server/models/account/user.ts4
-rw-r--r--server/models/oauth/oauth-token.ts4
-rw-r--r--server/tests/api/activitypub/security.ts3
-rw-r--r--server/tests/api/users/index.ts2
-rw-r--r--server/tests/api/videos/video-blacklist-management.ts3
-rw-r--r--server/tests/api/videos/video-channels.ts6
-rw-r--r--server/tests/api/videos/video-schedule-update.ts1
-rw-r--r--server/tests/api/videos/video-transcoder.ts6
-rw-r--r--server/tests/utils/index.ts1
-rw-r--r--server/tests/utils/requests/check-api-params.ts2
-rw-r--r--server/tests/utils/search/videos.ts2
-rw-r--r--server/tests/utils/server/config.ts2
-rw-r--r--server/tests/utils/server/jobs.ts3
-rw-r--r--server/tests/utils/server/stats.ts2
-rw-r--r--server/tests/utils/users/accounts.ts2
-rw-r--r--server/tests/utils/users/blocklist.ts2
-rw-r--r--server/tests/utils/users/user-subscriptions.ts2
-rw-r--r--server/tests/utils/users/users.ts2
-rw-r--r--server/tests/utils/videos/video-abuses.ts2
-rw-r--r--server/tests/utils/videos/video-captions.ts4
-rw-r--r--server/tests/utils/videos/video-channels.ts2
-rw-r--r--server/tests/utils/videos/video-comments.ts2
-rw-r--r--server/tests/utils/videos/video-imports.ts2
-rw-r--r--server/tests/utils/videos/videos.ts4
27 files changed, 41 insertions, 47 deletions
diff --git a/scripts/travis.sh b/scripts/travis.sh
index 49b7233e1..509b40d87 100755
--- a/scripts/travis.sh
+++ b/scripts/travis.sh
@@ -11,28 +11,25 @@ killall -q peertube || true
11 11
12if [ "$1" = "misc" ]; then 12if [ "$1" = "misc" ]; then
13 npm run build -- --light-fr 13 npm run build -- --light-fr
14 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/client.ts \ 14 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/client.ts \
15 server/tests/feeds/index.ts \ 15 server/tests/feeds/index.ts \
16 server/tests/misc-endpoints.ts \ 16 server/tests/misc-endpoints.ts \
17 server/tests/helpers/index.ts 17 server/tests/helpers/index.ts
18elif [ "$1" = "api" ]; then
19 npm run build:server
20 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index.ts
21elif [ "$1" = "cli" ]; then 18elif [ "$1" = "cli" ]; then
22 npm run build:server 19 npm run build:server
23 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/cli/index.ts 20 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/cli/index.ts
24elif [ "$1" = "api-1" ]; then 21elif [ "$1" = "api-1" ]; then
25 npm run build:server 22 npm run build:server
26 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-1.ts 23 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-1.ts
27elif [ "$1" = "api-2" ]; then 24elif [ "$1" = "api-2" ]; then
28 npm run build:server 25 npm run build:server
29 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-2.ts 26 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-2.ts
30elif [ "$1" = "api-3" ]; then 27elif [ "$1" = "api-3" ]; then
31 npm run build:server 28 npm run build:server
32 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-3.ts 29 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-3.ts
33elif [ "$1" = "api-4" ]; then 30elif [ "$1" = "api-4" ]; then
34 npm run build:server 31 npm run build:server
35 mocha --timeout 5000 --exit --require ts-node/register/type-check --bail server/tests/api/index-4.ts 32 mocha --timeout 5000 --exit --require ts-node/register --bail server/tests/api/index-4.ts
36elif [ "$1" = "lint" ]; then 33elif [ "$1" = "lint" ]; then
37 npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts" 34 npm run tslint -- --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" "shared/**/*.ts"
38 35
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index 8b9045038..b59e7e40e 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -1,7 +1,7 @@
1import * as ffmpeg from 'fluent-ffmpeg' 1import * as ffmpeg from 'fluent-ffmpeg'
2import { join } from 'path' 2import { join } from 'path'
3import { getTargetBitrate, VideoResolution } from '../../shared/models/videos' 3import { getTargetBitrate, VideoResolution } from '../../shared/models/videos'
4import { CONFIG, FFMPEG_NICE, VIDEO_TRANSCODING_FPS } from '../initializers' 4import { CONFIG, FFMPEG_NICE, VIDEO_TRANSCODING_FPS } from '../initializers/constants'
5import { processImage } from './image-utils' 5import { processImage } from './image-utils'
6import { logger } from './logger' 6import { logger } from './logger'
7import { checkFFmpegEncoders } from '../initializers/checker-before-init' 7import { checkFFmpegEncoders } from '../initializers/checker-before-init'
diff --git a/server/lib/user.ts b/server/lib/user.ts
index acb883e23..29d6d087d 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -17,10 +17,8 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
17 validate: validateUser 17 validate: validateUser
18 } 18 }
19 19
20 const [ userCreated, accountCreated ] = await Promise.all([ 20 const userCreated = await userToCreate.save(userOptions)
21 userToCreate.save(userOptions), 21 const accountCreated = await createLocalAccountWithoutKeys(userCreated.username, userCreated.id, null, t)
22 createLocalAccountWithoutKeys(userToCreate.username, userToCreate.id, null, t)
23 ])
24 userCreated.Account = accountCreated 22 userCreated.Account = accountCreated
25 23
26 let channelName = userCreated.username + '_channel' 24 let channelName = userCreated.username + '_channel'
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 34aafa1a7..1843603f1 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -1,6 +1,6 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { 2import {
3 AfterDelete, 3 AfterDestroy,
4 AfterUpdate, 4 AfterUpdate,
5 AllowNull, 5 AllowNull,
6 BeforeCreate, 6 BeforeCreate,
@@ -179,7 +179,7 @@ export class UserModel extends Model<UserModel> {
179 } 179 }
180 180
181 @AfterUpdate 181 @AfterUpdate
182 @AfterDelete 182 @AfterDestroy
183 static removeTokenCache (instance: UserModel) { 183 static removeTokenCache (instance: UserModel) {
184 return clearCacheByUserId(instance.id) 184 return clearCacheByUserId(instance.id)
185 } 185 }
diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts
index ecf846821..08d892da4 100644
--- a/server/models/oauth/oauth-token.ts
+++ b/server/models/oauth/oauth-token.ts
@@ -1,5 +1,5 @@
1import { 1import {
2 AfterDelete, 2 AfterDestroy,
3 AfterUpdate, 3 AfterUpdate,
4 AllowNull, 4 AllowNull,
5 BelongsTo, 5 BelongsTo,
@@ -126,7 +126,7 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> {
126 OAuthClients: OAuthClientModel[] 126 OAuthClients: OAuthClientModel[]
127 127
128 @AfterUpdate 128 @AfterUpdate
129 @AfterDelete 129 @AfterDestroy
130 static removeTokenCache (token: OAuthTokenModel) { 130 static removeTokenCache (token: OAuthTokenModel) {
131 return clearCacheByToken(token.accessToken) 131 return clearCacheByToken(token.accessToken)
132 } 132 }
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts
index e7899bb14..7349749f1 100644
--- a/server/tests/api/activitypub/security.ts
+++ b/server/tests/api/activitypub/security.ts
@@ -2,12 +2,13 @@
2 2
3import 'mocha' 3import 'mocha'
4 4
5import { flushAndRunMultipleServers, flushTests, killallServers, makePOSTAPRequest, makeFollowRequest, ServerInfo } from '../../utils' 5import { flushAndRunMultipleServers, flushTests, killallServers, ServerInfo } from '../../utils'
6import { HTTP_SIGNATURE } from '../../../initializers' 6import { HTTP_SIGNATURE } from '../../../initializers'
7import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' 7import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils'
8import * as chai from 'chai' 8import * as chai from 'chai'
9import { setActorField } from '../../utils/miscs/sql' 9import { setActorField } from '../../utils/miscs/sql'
10import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub' 10import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub'
11import { makeFollowRequest, makePOSTAPRequest } from '../../utils/requests/activitypub'
11 12
12const expect = chai.expect 13const expect = chai.expect
13 14
diff --git a/server/tests/api/users/index.ts b/server/tests/api/users/index.ts
index 0a1b8b0b2..ff433315d 100644
--- a/server/tests/api/users/index.ts
+++ b/server/tests/api/users/index.ts
@@ -1,5 +1,5 @@
1import './blocklist' 1import './blocklist'
2import './user-subscriptions' 2import './user-subscriptions'
3import './users' 3import './users'
4import './users-verification'
5import './users-multiple-servers' 4import './users-multiple-servers'
5import './users-verification'
diff --git a/server/tests/api/videos/video-blacklist-management.ts b/server/tests/api/videos/video-blacklist-management.ts
index 7bf39dc99..fab577b30 100644
--- a/server/tests/api/videos/video-blacklist-management.ts
+++ b/server/tests/api/videos/video-blacklist-management.ts
@@ -1,7 +1,7 @@
1/* tslint:disable:no-unused-expression */ 1/* tslint:disable:no-unused-expression */
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import * as lodash from 'lodash' 4import { orderBy } from 'lodash'
5import 'mocha' 5import 'mocha'
6import { 6import {
7 addVideoToBlacklist, 7 addVideoToBlacklist,
@@ -22,7 +22,6 @@ import { waitJobs } from '../../utils/server/jobs'
22import { VideoAbuse } from '../../../../shared/models/videos' 22import { VideoAbuse } from '../../../../shared/models/videos'
23 23
24const expect = chai.expect 24const expect = chai.expect
25const orderBy = lodash.orderBy
26 25
27describe('Test video blacklist management', function () { 26describe('Test video blacklist management', function () {
28 let servers: ServerInfo[] = [] 27 let servers: ServerInfo[] = []
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index 8138c65d6..41429a3d8 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -7,10 +7,12 @@ import {
7 createUser, 7 createUser,
8 doubleFollow, 8 doubleFollow,
9 flushAndRunMultipleServers, 9 flushAndRunMultipleServers,
10 getVideoChannelVideos, serverLogin, testImage, 10 getVideoChannelVideos,
11 testImage,
11 updateVideo, 12 updateVideo,
12 updateVideoChannelAvatar, 13 updateVideoChannelAvatar,
13 uploadVideo, wait, userLogin 14 uploadVideo,
15 userLogin
14} from '../../utils' 16} from '../../utils'
15import { 17import {
16 addVideoChannel, 18 addVideoChannel,
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts
index a260fa4da..b226a9d50 100644
--- a/server/tests/api/videos/video-schedule-update.ts
+++ b/server/tests/api/videos/video-schedule-update.ts
@@ -16,7 +16,6 @@ import {
16 uploadVideo, 16 uploadVideo,
17 wait 17 wait
18} from '../../utils' 18} from '../../utils'
19import { join } from 'path'
20import { waitJobs } from '../../utils/server/jobs' 19import { waitJobs } from '../../utils/server/jobs'
21 20
22const expect = chai.expect 21const expect = chai.expect
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 85795d2ed..23920d452 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -3,13 +3,13 @@
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import * as ffmpeg from 'fluent-ffmpeg'
7import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos' 6import { getMaxBitrate, VideoDetails, VideoResolution, VideoState } from '../../../../shared/models/videos'
8import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils' 7import { audio, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg-utils'
9import { 8import {
10 buildAbsoluteFixturePath, 9 buildAbsoluteFixturePath,
11 doubleFollow, 10 doubleFollow,
12 flushAndRunMultipleServers, 11 flushAndRunMultipleServers,
12 generateHighBitrateVideo,
13 getMyVideos, 13 getMyVideos,
14 getVideo, 14 getVideo,
15 getVideosList, 15 getVideosList,
@@ -18,12 +18,10 @@ import {
18 ServerInfo, 18 ServerInfo,
19 setAccessTokensToServers, 19 setAccessTokensToServers,
20 uploadVideo, 20 uploadVideo,
21 webtorrentAdd, 21 webtorrentAdd
22 generateHighBitrateVideo
23} from '../../utils' 22} from '../../utils'
24import { join } from 'path' 23import { join } from 'path'
25import { waitJobs } from '../../utils/server/jobs' 24import { waitJobs } from '../../utils/server/jobs'
26import { pathExists } from 'fs-extra'
27import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' 25import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants'
28 26
29const expect = chai.expect 27const expect = chai.expect
diff --git a/server/tests/utils/index.ts b/server/tests/utils/index.ts
index 905d93823..8349631c9 100644
--- a/server/tests/utils/index.ts
+++ b/server/tests/utils/index.ts
@@ -7,7 +7,6 @@ export * from './miscs/miscs'
7export * from './miscs/stubs' 7export * from './miscs/stubs'
8export * from './server/follows' 8export * from './server/follows'
9export * from './requests/requests' 9export * from './requests/requests'
10export * from './requests/activitypub'
11export * from './server/servers' 10export * from './server/servers'
12export * from './videos/services' 11export * from './videos/services'
13export * from './users/users' 12export * from './users/users'
diff --git a/server/tests/utils/requests/check-api-params.ts b/server/tests/utils/requests/check-api-params.ts
index edb47e0e9..a2a549682 100644
--- a/server/tests/utils/requests/check-api-params.ts
+++ b/server/tests/utils/requests/check-api-params.ts
@@ -1,5 +1,5 @@
1import { makeGetRequest } from './requests' 1import { makeGetRequest } from './requests'
2import { immutableAssign } from '..' 2import { immutableAssign } from '../miscs/miscs'
3 3
4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { 4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
5 return makeGetRequest({ 5 return makeGetRequest({
diff --git a/server/tests/utils/search/videos.ts b/server/tests/utils/search/videos.ts
index 3a0c10e42..8c0037ccc 100644
--- a/server/tests/utils/search/videos.ts
+++ b/server/tests/utils/search/videos.ts
@@ -2,7 +2,7 @@
2 2
3import * as request from 'supertest' 3import * as request from 'supertest'
4import { VideosSearchQuery } from '../../../../shared/models/search' 4import { VideosSearchQuery } from '../../../../shared/models/search'
5import { immutableAssign } from '..' 5import { immutableAssign } from '../miscs/miscs'
6 6
7function searchVideo (url: string, search: string) { 7function searchVideo (url: string, search: string) {
8 const path = '/api/v1/search/videos' 8 const path = '/api/v1/search/videos'
diff --git a/server/tests/utils/server/config.ts b/server/tests/utils/server/config.ts
index b85e02ab7..aa3100d34 100644
--- a/server/tests/utils/server/config.ts
+++ b/server/tests/utils/server/config.ts
@@ -1,4 +1,4 @@
1import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../' 1import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
2import { CustomConfig } from '../../../../shared/models/server/custom-config.model' 2import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
3 3
4function getConfig (url: string) { 4function getConfig (url: string) {
diff --git a/server/tests/utils/server/jobs.ts b/server/tests/utils/server/jobs.ts
index 4c02cace5..26180ec72 100644
--- a/server/tests/utils/server/jobs.ts
+++ b/server/tests/utils/server/jobs.ts
@@ -1,6 +1,7 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { Job, JobState } from '../../../../shared/models' 2import { Job, JobState } from '../../../../shared/models'
3import { ServerInfo, wait } from '../index' 3import { ServerInfo } from './servers'
4import { wait } from '../miscs/miscs'
4 5
5function getJobsList (url: string, accessToken: string, state: JobState) { 6function getJobsList (url: string, accessToken: string, state: JobState) {
6 const path = '/api/v1/jobs/' + state 7 const path = '/api/v1/jobs/' + state
diff --git a/server/tests/utils/server/stats.ts b/server/tests/utils/server/stats.ts
index 01989d952..6f079ad18 100644
--- a/server/tests/utils/server/stats.ts
+++ b/server/tests/utils/server/stats.ts
@@ -1,4 +1,4 @@
1import { makeGetRequest } from '../' 1import { makeGetRequest } from '../requests/requests'
2 2
3function getStats (url: string, useCache = false) { 3function getStats (url: string, useCache = false) {
4 const path = '/api/v1/server/stats' 4 const path = '/api/v1/server/stats'
diff --git a/server/tests/utils/users/accounts.ts b/server/tests/utils/users/accounts.ts
index f82b8d906..257fa5b27 100644
--- a/server/tests/utils/users/accounts.ts
+++ b/server/tests/utils/users/accounts.ts
@@ -4,7 +4,7 @@ import { expect } from 'chai'
4import { existsSync, readdir } from 'fs-extra' 4import { existsSync, readdir } from 'fs-extra'
5import { join } from 'path' 5import { join } from 'path'
6import { Account } from '../../../../shared/models/actors' 6import { Account } from '../../../../shared/models/actors'
7import { root } from '../index' 7import { root } from '../miscs/miscs'
8import { makeGetRequest } from '../requests/requests' 8import { makeGetRequest } from '../requests/requests'
9 9
10function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { 10function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) {
diff --git a/server/tests/utils/users/blocklist.ts b/server/tests/utils/users/blocklist.ts
index 35b537571..0ead5e5f6 100644
--- a/server/tests/utils/users/blocklist.ts
+++ b/server/tests/utils/users/blocklist.ts
@@ -1,6 +1,6 @@
1/* tslint:disable:no-unused-expression */ 1/* tslint:disable:no-unused-expression */
2 2
3import { makeDeleteRequest, makePostBodyRequest } from '../index' 3import { makeDeleteRequest, makePostBodyRequest } from '../requests/requests'
4import { makeGetRequest } from '../requests/requests' 4import { makeGetRequest } from '../requests/requests'
5 5
6function getAccountBlocklistByAccount ( 6function getAccountBlocklistByAccount (
diff --git a/server/tests/utils/users/user-subscriptions.ts b/server/tests/utils/users/user-subscriptions.ts
index b0e7da7cc..7148fbfca 100644
--- a/server/tests/utils/users/user-subscriptions.ts
+++ b/server/tests/utils/users/user-subscriptions.ts
@@ -1,4 +1,4 @@
1import { makeDeleteRequest, makeGetRequest, makePostBodyRequest } from '../' 1import { makeDeleteRequest, makeGetRequest, makePostBodyRequest } from '../requests/requests'
2 2
3function addUserSubscription (url: string, token: string, targetUri: string, statusCodeExpected = 204) { 3function addUserSubscription (url: string, token: string, targetUri: string, statusCodeExpected = 204) {
4 const path = '/api/v1/users/me/subscriptions' 4 const path = '/api/v1/users/me/subscriptions'
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index d77233d62..2c21a9ecf 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -1,5 +1,5 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../' 2import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../requests/requests'
3 3
4import { UserRole } from '../../../../shared/index' 4import { UserRole } from '../../../../shared/index'
5import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type' 5import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type'
diff --git a/server/tests/utils/videos/video-abuses.ts b/server/tests/utils/videos/video-abuses.ts
index 14907e6a0..4ad82ad8c 100644
--- a/server/tests/utils/videos/video-abuses.ts
+++ b/server/tests/utils/videos/video-abuses.ts
@@ -1,6 +1,6 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { VideoAbuseUpdate } from '../../../../shared/models/videos/abuse/video-abuse-update.model' 2import { VideoAbuseUpdate } from '../../../../shared/models/videos/abuse/video-abuse-update.model'
3import { makeDeleteRequest, makePutBodyRequest } from '..' 3import { makeDeleteRequest, makePutBodyRequest } from '../requests/requests'
4 4
5function reportVideoAbuse (url: string, token: string, videoId: number | string, reason: string, specialStatus = 200) { 5function reportVideoAbuse (url: string, token: string, videoId: number | string, reason: string, specialStatus = 200) {
6 const path = '/api/v1/videos/' + videoId + '/abuse' 6 const path = '/api/v1/videos/' + videoId + '/abuse'
diff --git a/server/tests/utils/videos/video-captions.ts b/server/tests/utils/videos/video-captions.ts
index 41e52be07..8d67f617b 100644
--- a/server/tests/utils/videos/video-captions.ts
+++ b/server/tests/utils/videos/video-captions.ts
@@ -1,7 +1,7 @@
1import { makeDeleteRequest, makeGetRequest } from '../' 1import { makeDeleteRequest, makeGetRequest, makeUploadRequest } from '../requests/requests'
2import { buildAbsoluteFixturePath, makeUploadRequest } from '../index'
3import * as request from 'supertest' 2import * as request from 'supertest'
4import * as chai from 'chai' 3import * as chai from 'chai'
4import { buildAbsoluteFixturePath } from '../miscs/miscs'
5 5
6const expect = chai.expect 6const expect = chai.expect
7 7
diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts
index 092985777..70e8d1a6b 100644
--- a/server/tests/utils/videos/video-channels.ts
+++ b/server/tests/utils/videos/video-channels.ts
@@ -1,6 +1,6 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' 2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos'
3import { updateAvatarRequest } from '../index' 3import { updateAvatarRequest } from '../requests/requests'
4 4
5function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { 5function getVideoChannelsList (url: string, start: number, count: number, sort?: string) {
6 const path = '/api/v1/video-channels' 6 const path = '/api/v1/video-channels'
diff --git a/server/tests/utils/videos/video-comments.ts b/server/tests/utils/videos/video-comments.ts
index 7d4cae364..0ebf69ced 100644
--- a/server/tests/utils/videos/video-comments.ts
+++ b/server/tests/utils/videos/video-comments.ts
@@ -1,5 +1,5 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { makeDeleteRequest } from '../' 2import { makeDeleteRequest } from '../requests/requests'
3 3
4function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string, token?: string) { 4function getVideoCommentThreads (url: string, videoId: number | string, start: number, count: number, sort?: string, token?: string) {
5 const path = '/api/v1/videos/' + videoId + '/comment-threads' 5 const path = '/api/v1/videos/' + videoId + '/comment-threads'
diff --git a/server/tests/utils/videos/video-imports.ts b/server/tests/utils/videos/video-imports.ts
index 59dfd481a..eb985a5b1 100644
--- a/server/tests/utils/videos/video-imports.ts
+++ b/server/tests/utils/videos/video-imports.ts
@@ -1,5 +1,5 @@
1import { VideoImportCreate } from '../../../../shared/models/videos' 1import { VideoImportCreate } from '../../../../shared/models/videos'
2import { makeGetRequest, makeUploadRequest } from '..' 2import { makeGetRequest, makeUploadRequest } from '../requests/requests'
3 3
4function getYoutubeVideoUrl () { 4function getYoutubeVideoUrl () {
5 return 'https://youtu.be/msX3jv1XdvM' 5 return 'https://youtu.be/msX3jv1XdvM'
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 87c385f38..d6c3e5dac 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -17,8 +17,8 @@ import {
17 testImage 17 testImage
18} from '../' 18} from '../'
19import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos' 19import { VideoDetails, VideoPrivacy } from '../../../../shared/models/videos'
20import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers' 20import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers/constants'
21import { dateIsValid, webtorrentAdd } from '../index' 21import { dateIsValid, webtorrentAdd } from '../miscs/miscs'
22 22
23type VideoAttributes = { 23type VideoAttributes = {
24 name?: string 24 name?: string