diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:44:32 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:47:54 +0200 |
commit | 863477173efa82a4412d2e522aa46462249f9199 (patch) | |
tree | 40f0ae28691780d79acef5ba4dbd2ef0694ce8ff /server | |
parent | e0faa8ad6e18ce6248ef1ec93a59dab5b05be468 (diff) | |
download | PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.gz PeerTube-863477173efa82a4412d2e522aa46462249f9199.tar.zst PeerTube-863477173efa82a4412d2e522aa46462249f9199.zip |
Cleanup tests imports
Diffstat (limited to 'server')
103 files changed, 106 insertions, 304 deletions
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index c80c86193..17750379d 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts | |||
@@ -136,12 +136,6 @@ function toValueOrNull (value: string) { | |||
136 | return value | 136 | return value |
137 | } | 137 | } |
138 | 138 | ||
139 | function toArray (value: any) { | ||
140 | if (value && isArray(value) === false) return [ value ] | ||
141 | |||
142 | return value | ||
143 | } | ||
144 | |||
145 | function toIntArray (value: any) { | 139 | function toIntArray (value: any) { |
146 | if (!value) return [] | 140 | if (!value) return [] |
147 | if (isArray(value) === false) return [ validator.toInt(value) ] | 141 | if (isArray(value) === false) return [ validator.toInt(value) ] |
@@ -170,7 +164,6 @@ export { | |||
170 | isBooleanValid, | 164 | isBooleanValid, |
171 | toIntOrNull, | 165 | toIntOrNull, |
172 | areUUIDsValid, | 166 | areUUIDsValid, |
173 | toArray, | ||
174 | toIntArray, | 167 | toIntArray, |
175 | isFileValid, | 168 | isFileValid, |
176 | checkMimetypeRegex | 169 | checkMimetypeRegex |
diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts index 1bae3764a..8ec6cb01d 100644 --- a/server/middlewares/validators/blocklist.ts +++ b/server/middlewares/validators/blocklist.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { body, param, query } from 'express-validator' | 2 | import { body, param, query } from 'express-validator' |
3 | import { areValidActorHandles } from '@server/helpers/custom-validators/activitypub/actor' | 3 | import { areValidActorHandles } from '@server/helpers/custom-validators/activitypub/actor' |
4 | import { toArray } from '@server/helpers/custom-validators/misc' | ||
5 | import { getServerActor } from '@server/models/application/application' | 4 | import { getServerActor } from '@server/models/application/application' |
5 | import { arrayify } from '@shared/core-utils' | ||
6 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 6 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
7 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' | 7 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' |
8 | import { WEBSERVER } from '../../initializers/constants' | 8 | import { WEBSERVER } from '../../initializers/constants' |
@@ -121,12 +121,12 @@ const unblockServerByServerValidator = [ | |||
121 | const blocklistStatusValidator = [ | 121 | const blocklistStatusValidator = [ |
122 | query('hosts') | 122 | query('hosts') |
123 | .optional() | 123 | .optional() |
124 | .customSanitizer(toArray) | 124 | .customSanitizer(arrayify) |
125 | .custom(isEachUniqueHostValid).withMessage('Should have a valid hosts array'), | 125 | .custom(isEachUniqueHostValid).withMessage('Should have a valid hosts array'), |
126 | 126 | ||
127 | query('accounts') | 127 | query('accounts') |
128 | .optional() | 128 | .optional() |
129 | .customSanitizer(toArray) | 129 | .customSanitizer(arrayify) |
130 | .custom(areValidActorHandles).withMessage('Should have a valid accounts array'), | 130 | .custom(areValidActorHandles).withMessage('Should have a valid accounts array'), |
131 | 131 | ||
132 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 132 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
diff --git a/server/middlewares/validators/logs.ts b/server/middlewares/validators/logs.ts index 584cb2aaf..2d828bb42 100644 --- a/server/middlewares/validators/logs.ts +++ b/server/middlewares/validators/logs.ts | |||
@@ -3,6 +3,7 @@ import { body, query } from 'express-validator' | |||
3 | import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc' | 3 | import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc' |
4 | import { isStringArray } from '@server/helpers/custom-validators/search' | 4 | import { isStringArray } from '@server/helpers/custom-validators/search' |
5 | import { CONFIG } from '@server/initializers/config' | 5 | import { CONFIG } from '@server/initializers/config' |
6 | import { arrayify } from '@shared/core-utils' | ||
6 | import { HttpStatusCode } from '@shared/models' | 7 | import { HttpStatusCode } from '@shared/models' |
7 | import { | 8 | import { |
8 | isValidClientLogLevel, | 9 | isValidClientLogLevel, |
@@ -12,7 +13,7 @@ import { | |||
12 | isValidClientLogUserAgent, | 13 | isValidClientLogUserAgent, |
13 | isValidLogLevel | 14 | isValidLogLevel |
14 | } from '../../helpers/custom-validators/logs' | 15 | } from '../../helpers/custom-validators/logs' |
15 | import { isDateValid, toArray } from '../../helpers/custom-validators/misc' | 16 | import { isDateValid } from '../../helpers/custom-validators/misc' |
16 | import { areValidationErrors } from './shared' | 17 | import { areValidationErrors } from './shared' |
17 | 18 | ||
18 | const createClientLogValidator = [ | 19 | const createClientLogValidator = [ |
@@ -56,7 +57,7 @@ const getLogsValidator = [ | |||
56 | .custom(isValidLogLevel), | 57 | .custom(isValidLogLevel), |
57 | query('tagsOneOf') | 58 | query('tagsOneOf') |
58 | .optional() | 59 | .optional() |
59 | .customSanitizer(toArray) | 60 | .customSanitizer(arrayify) |
60 | .custom(isStringArray).withMessage('Should have a valid one of tags array'), | 61 | .custom(isStringArray).withMessage('Should have a valid one of tags array'), |
61 | query('endDate') | 62 | query('endDate') |
62 | .optional() | 63 | .optional() |
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts index a76628915..d01043c17 100644 --- a/server/middlewares/validators/user-subscriptions.ts +++ b/server/middlewares/validators/user-subscriptions.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { arrayify } from '@shared/core-utils' | ||
1 | import express from 'express' | 2 | import express from 'express' |
2 | import { body, param, query } from 'express-validator' | 3 | import { body, param, query } from 'express-validator' |
3 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
4 | import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' | 5 | import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' |
5 | import { toArray } from '../../helpers/custom-validators/misc' | ||
6 | import { WEBSERVER } from '../../initializers/constants' | 6 | import { WEBSERVER } from '../../initializers/constants' |
7 | import { ActorFollowModel } from '../../models/actor/actor-follow' | 7 | import { ActorFollowModel } from '../../models/actor/actor-follow' |
8 | import { areValidationErrors } from './shared' | 8 | import { areValidationErrors } from './shared' |
@@ -32,7 +32,7 @@ const userSubscriptionAddValidator = [ | |||
32 | 32 | ||
33 | const areSubscriptionsExistValidator = [ | 33 | const areSubscriptionsExistValidator = [ |
34 | query('uris') | 34 | query('uris') |
35 | .customSanitizer(toArray) | 35 | .customSanitizer(arrayify) |
36 | .custom(areValidActorHandles).withMessage('Should have a valid array of URIs'), | 36 | .custom(areValidActorHandles).withMessage('Should have a valid array of URIs'), |
37 | 37 | ||
38 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 38 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 3d93bc62f..7fd2b03d1 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -6,7 +6,7 @@ import { Redis } from '@server/lib/redis' | |||
6 | import { getServerActor } from '@server/models/application/application' | 6 | import { getServerActor } from '@server/models/application/application' |
7 | import { ExpressPromiseHandler } from '@server/types/express-handler' | 7 | import { ExpressPromiseHandler } from '@server/types/express-handler' |
8 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' | 8 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' |
9 | import { getAllPrivacies } from '@shared/core-utils' | 9 | import { arrayify, getAllPrivacies } from '@shared/core-utils' |
10 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude } from '@shared/models' | 10 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude } from '@shared/models' |
11 | import { | 11 | import { |
12 | exists, | 12 | exists, |
@@ -14,7 +14,6 @@ import { | |||
14 | isDateValid, | 14 | isDateValid, |
15 | isFileValid, | 15 | isFileValid, |
16 | isIdValid, | 16 | isIdValid, |
17 | toArray, | ||
18 | toBooleanOrNull, | 17 | toBooleanOrNull, |
19 | toIntOrNull, | 18 | toIntOrNull, |
20 | toValueOrNull | 19 | toValueOrNull |
@@ -419,27 +418,27 @@ function getCommonVideoEditAttributes () { | |||
419 | const commonVideosFiltersValidator = [ | 418 | const commonVideosFiltersValidator = [ |
420 | query('categoryOneOf') | 419 | query('categoryOneOf') |
421 | .optional() | 420 | .optional() |
422 | .customSanitizer(toArray) | 421 | .customSanitizer(arrayify) |
423 | .custom(isNumberArray).withMessage('Should have a valid categoryOneOf array'), | 422 | .custom(isNumberArray).withMessage('Should have a valid categoryOneOf array'), |
424 | query('licenceOneOf') | 423 | query('licenceOneOf') |
425 | .optional() | 424 | .optional() |
426 | .customSanitizer(toArray) | 425 | .customSanitizer(arrayify) |
427 | .custom(isNumberArray).withMessage('Should have a valid licenceOneOf array'), | 426 | .custom(isNumberArray).withMessage('Should have a valid licenceOneOf array'), |
428 | query('languageOneOf') | 427 | query('languageOneOf') |
429 | .optional() | 428 | .optional() |
430 | .customSanitizer(toArray) | 429 | .customSanitizer(arrayify) |
431 | .custom(isStringArray).withMessage('Should have a valid languageOneOf array'), | 430 | .custom(isStringArray).withMessage('Should have a valid languageOneOf array'), |
432 | query('privacyOneOf') | 431 | query('privacyOneOf') |
433 | .optional() | 432 | .optional() |
434 | .customSanitizer(toArray) | 433 | .customSanitizer(arrayify) |
435 | .custom(isNumberArray).withMessage('Should have a valid privacyOneOf array'), | 434 | .custom(isNumberArray).withMessage('Should have a valid privacyOneOf array'), |
436 | query('tagsOneOf') | 435 | query('tagsOneOf') |
437 | .optional() | 436 | .optional() |
438 | .customSanitizer(toArray) | 437 | .customSanitizer(arrayify) |
439 | .custom(isStringArray).withMessage('Should have a valid tagsOneOf array'), | 438 | .custom(isStringArray).withMessage('Should have a valid tagsOneOf array'), |
440 | query('tagsAllOf') | 439 | query('tagsAllOf') |
441 | .optional() | 440 | .optional() |
442 | .customSanitizer(toArray) | 441 | .customSanitizer(arrayify) |
443 | .custom(isStringArray).withMessage('Should have a valid tagsAllOf array'), | 442 | .custom(isStringArray).withMessage('Should have a valid tagsAllOf array'), |
444 | query('nsfw') | 443 | query('nsfw') |
445 | .optional() | 444 | .optional() |
diff --git a/server/tests/api/activitypub/cleaner.ts b/server/tests/api/activitypub/cleaner.ts index d0a151f5c..eb6779123 100644 --- a/server/tests/api/activitypub/cleaner.ts +++ b/server/tests/api/activitypub/cleaner.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 { expect } from 'chai' |
4 | import * as chai from 'chai' | ||
5 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
6 | import { | 5 | import { |
7 | cleanupTests, | 6 | cleanupTests, |
@@ -12,8 +11,6 @@ import { | |||
12 | waitJobs | 11 | waitJobs |
13 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
14 | 13 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test AP cleaner', function () { | 14 | describe('Test AP cleaner', function () { |
18 | let servers: PeerTubeServer[] = [] | 15 | let servers: PeerTubeServer[] = [] |
19 | let videoUUID1: string | 16 | let videoUUID1: string |
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index b12ffe341..90c89138c 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { processViewersStats } from '@server/tests/shared' | 4 | import { processViewersStats } from '@server/tests/shared' |
5 | import { HttpStatusCode, VideoPlaylistPrivacy, WatchActionObject } from '@shared/models' | 5 | import { HttpStatusCode, VideoPlaylistPrivacy, WatchActionObject } from '@shared/models' |
6 | import { | 6 | import { |
@@ -13,8 +13,6 @@ import { | |||
13 | setDefaultVideoChannel | 13 | setDefaultVideoChannel |
14 | } from '@shared/server-commands' | 14 | } from '@shared/server-commands' |
15 | 15 | ||
16 | const expect = chai.expect | ||
17 | |||
18 | describe('Test activitypub', function () { | 16 | describe('Test activitypub', function () { |
19 | let servers: PeerTubeServer[] = [] | 17 | let servers: PeerTubeServer[] = [] |
20 | let video: { id: number, uuid: string, shortUUID: string } | 18 | let video: { id: number, uuid: string, shortUUID: string } |
diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index cc71e82ea..4edabd1d9 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.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 { expect } from 'chai' |
4 | import * as chai from 'chai' | ||
5 | import { | 4 | import { |
6 | cleanupTests, | 5 | cleanupTests, |
7 | createMultipleServers, | 6 | createMultipleServers, |
@@ -11,8 +10,6 @@ import { | |||
11 | waitJobs | 10 | waitJobs |
12 | } from '@shared/server-commands' | 11 | } from '@shared/server-commands' |
13 | 12 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test ActivityPub fetcher', function () { | 13 | describe('Test ActivityPub fetcher', function () { |
17 | let servers: PeerTubeServer[] | 14 | let servers: PeerTubeServer[] |
18 | 15 | ||
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index bb81d4565..401a09090 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { wait } from '@shared/core-utils' | 3 | import { wait } from '@shared/core-utils' |
5 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' | 4 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
6 | import { | 5 | import { |
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index 5e29b744f..423fefb10 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { buildDigest } from '@server/helpers/peertube-crypto' | 4 | import { buildDigest } from '@server/helpers/peertube-crypto' |
5 | import { HTTP_SIGNATURE } from '@server/initializers/constants' | 5 | import { HTTP_SIGNATURE } from '@server/initializers/constants' |
6 | import { activityPubContextify } from '@server/lib/activitypub/context' | 6 | import { activityPubContextify } from '@server/lib/activitypub/context' |
@@ -10,8 +10,6 @@ import { buildAbsoluteFixturePath, wait } from '@shared/core-utils' | |||
10 | import { HttpStatusCode } from '@shared/models' | 10 | import { HttpStatusCode } from '@shared/models' |
11 | import { cleanupTests, createMultipleServers, killallServers, PeerTubeServer } from '@shared/server-commands' | 11 | import { cleanupTests, createMultipleServers, killallServers, PeerTubeServer } from '@shared/server-commands' |
12 | 12 | ||
13 | const expect = chai.expect | ||
14 | |||
15 | function setKeysOfServer (onServer: PeerTubeServer, ofServer: PeerTubeServer, publicKey: string, privateKey: string) { | 13 | function setKeysOfServer (onServer: PeerTubeServer, ofServer: PeerTubeServer, publicKey: string, privateKey: string) { |
16 | const url = 'http://localhost:' + ofServer.port + '/accounts/peertube' | 14 | const url = 'http://localhost:' + ofServer.port + '/accounts/peertube' |
17 | 15 | ||
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts index 7d8347412..331d3f8f7 100644 --- a/server/tests/api/check-params/abuses.ts +++ b/server/tests/api/check-params/abuses.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | 3 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' |
5 | import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models' | 4 | import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models' |
6 | import { | 5 | import { |
diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.ts index 36526d494..f745b9088 100644 --- a/server/tests/api/check-params/blocklist.ts +++ b/server/tests/api/check-params/blocklist.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | 3 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' |
5 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode } from '@shared/models' |
6 | import { | 5 | import { |
diff --git a/server/tests/api/check-params/channel-import-videos.ts b/server/tests/api/check-params/channel-import-videos.ts index 14587c376..0ec5fc2b9 100644 --- a/server/tests/api/check-params/channel-import-videos.ts +++ b/server/tests/api/check-params/channel-import-videos.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { FIXTURE_URLS } from '@server/tests/shared' | 3 | import { FIXTURE_URLS } from '@server/tests/shared' |
5 | import { areHttpImportTestsDisabled } from '@shared/core-utils' | 4 | import { areHttpImportTestsDisabled } from '@shared/core-utils' |
6 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
diff --git a/server/tests/api/check-params/logs.ts b/server/tests/api/check-params/logs.ts index f9a99796d..2496cee31 100644 --- a/server/tests/api/check-params/logs.ts +++ b/server/tests/api/check-params/logs.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
5 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 5 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.ts index c3f15b86e..02f0d010d 100644 --- a/server/tests/api/check-params/plugins.ts +++ b/server/tests/api/check-params/plugins.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | 3 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' |
5 | import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models' | 4 | import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models' |
6 | import { | 5 | import { |
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index 0ec3f49d5..4dc84d3f2 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | 4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' |
6 | import { HttpStatusCode, VideoBlacklistType } from '@shared/models' | 5 | import { HttpStatusCode, VideoBlacklistType } from '@shared/models' |
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index ccf36948e..550198844 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | 4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' |
5 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' | 5 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -13,8 +13,6 @@ import { | |||
13 | setAccessTokensToServers | 13 | setAccessTokensToServers |
14 | } from '@shared/server-commands' | 14 | } from '@shared/server-commands' |
15 | 15 | ||
16 | const expect = chai.expect | ||
17 | |||
18 | describe('Test video comments API validator', function () { | 16 | describe('Test video comments API validator', function () { |
19 | let pathThread: string | 17 | let pathThread: string |
20 | let pathComment: string | 18 | let pathComment: string |
diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts index 876538302..64ef73a2a 100644 --- a/server/tests/api/live/live-constraints.ts +++ b/server/tests/api/live/live-constraints.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { LiveVideoError, VideoPrivacy } from '@shared/models' | 5 | import { LiveVideoError, VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -18,8 +18,6 @@ import { | |||
18 | } from '@shared/server-commands' | 18 | } from '@shared/server-commands' |
19 | import { checkLiveCleanup } from '../../shared' | 19 | import { checkLiveCleanup } from '../../shared' |
20 | 20 | ||
21 | const expect = chai.expect | ||
22 | |||
23 | describe('Test live constraints', function () { | 21 | describe('Test live constraints', function () { |
24 | let servers: PeerTubeServer[] = [] | 22 | let servers: PeerTubeServer[] = [] |
25 | let userId: number | 23 | let userId: number |
diff --git a/server/tests/api/live/live-fast-restream.ts b/server/tests/api/live/live-fast-restream.ts index d3dae9e98..502959258 100644 --- a/server/tests/api/live/live-fast-restream.ts +++ b/server/tests/api/live/live-fast-restream.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models' | 5 | import { HttpStatusCode, LiveVideoCreate, VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Fast restream in live', function () { | 17 | describe('Fast restream in live', function () { |
20 | let server: PeerTubeServer | 18 | let server: PeerTubeServer |
21 | 19 | ||
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts index da392ba84..5d227200e 100644 --- a/server/tests/api/live/live-permanent.ts +++ b/server/tests/api/live/live-permanent.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' | 5 | import { LiveVideoCreate, VideoPrivacy, VideoState } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | waitJobs | 15 | waitJobs |
16 | } from '@shared/server-commands' | 16 | } from '@shared/server-commands' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | describe('Permanent live', function () { | 18 | describe('Permanent live', function () { |
21 | let servers: PeerTubeServer[] = [] | 19 | let servers: PeerTubeServer[] = [] |
22 | let videoUUID: string | 20 | let videoUUID: string |
diff --git a/server/tests/api/live/live-rtmps.ts b/server/tests/api/live/live-rtmps.ts index 46cfef989..dcaee90cf 100644 --- a/server/tests/api/live/live-rtmps.ts +++ b/server/tests/api/live/live-rtmps.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | 4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' |
5 | import { VideoPrivacy } from '@shared/models' | 5 | import { VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | waitUntilLivePublishedOnAllServers | 15 | waitUntilLivePublishedOnAllServers |
16 | } from '@shared/server-commands' | 16 | } from '@shared/server-commands' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | describe('Test live RTMPS', function () { | 18 | describe('Test live RTMPS', function () { |
21 | let server: PeerTubeServer | 19 | let server: PeerTubeServer |
22 | let rtmpUrl: string | 20 | let rtmpUrl: string |
diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts index 80df93924..7014292d0 100644 --- a/server/tests/api/live/live-save-replay.ts +++ b/server/tests/api/live/live-save-replay.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { FfmpegCommand } from 'fluent-ffmpeg' | 4 | import { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { checkLiveCleanup } from '@server/tests/shared' | 5 | import { checkLiveCleanup } from '@server/tests/shared' |
6 | import { wait } from '@shared/core-utils' | 6 | import { wait } from '@shared/core-utils' |
@@ -22,8 +22,6 @@ import { | |||
22 | waitUntilLiveWaitingOnAllServers | 22 | waitUntilLiveWaitingOnAllServers |
23 | } from '@shared/server-commands' | 23 | } from '@shared/server-commands' |
24 | 24 | ||
25 | const expect = chai.expect | ||
26 | |||
27 | describe('Save replay setting', function () { | 25 | describe('Save replay setting', function () { |
28 | let servers: PeerTubeServer[] = [] | 26 | let servers: PeerTubeServer[] = [] |
29 | let liveVideoUUID: string | 27 | let liveVideoUUID: string |
diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts index 7c2b449ac..62b7a6d22 100644 --- a/server/tests/api/live/live-socket-messages.ts +++ b/server/tests/api/live/live-socket-messages.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideoPrivacy, VideoState } from '@shared/models' | 5 | import { VideoPrivacy, VideoState } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | waitUntilLivePublishedOnAllServers | 15 | waitUntilLivePublishedOnAllServers |
16 | } from '@shared/server-commands' | 16 | } from '@shared/server-commands' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | describe('Test live socket messages', function () { | 18 | describe('Test live socket messages', function () { |
21 | let servers: PeerTubeServer[] = [] | 19 | let servers: PeerTubeServer[] = [] |
22 | 20 | ||
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index 8d3bf61a1..48982f4de 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { basename, join } from 'path' | 4 | import { basename, join } from 'path' |
5 | import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg' | 5 | import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg' |
6 | import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist, getAllFiles, testImage } from '@server/tests/shared' | 6 | import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist, getAllFiles, testImage } from '@server/tests/shared' |
@@ -32,8 +32,6 @@ import { | |||
32 | waitUntilLivePublishedOnAllServers | 32 | waitUntilLivePublishedOnAllServers |
33 | } from '@shared/server-commands' | 33 | } from '@shared/server-commands' |
34 | 34 | ||
35 | const expect = chai.expect | ||
36 | |||
37 | describe('Test live', function () { | 35 | describe('Test live', function () { |
38 | let servers: PeerTubeServer[] = [] | 36 | let servers: PeerTubeServer[] = [] |
39 | let commands: LiveCommand[] | 37 | let commands: LiveCommand[] |
diff --git a/server/tests/api/moderation/abuses.ts b/server/tests/api/moderation/abuses.ts index 1c083a3d1..d9c164c43 100644 --- a/server/tests/api/moderation/abuses.ts +++ b/server/tests/api/moderation/abuses.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse } from '@shared/models' | 4 | import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse } from '@shared/models' |
5 | import { | 5 | import { |
6 | AbusesCommand, | 6 | AbusesCommand, |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test abuses', function () { | 17 | describe('Test abuses', function () { |
20 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
21 | let abuseServer1: AdminAbuse | 19 | let abuseServer1: AdminAbuse |
diff --git a/server/tests/api/moderation/blocklist-notification.ts b/server/tests/api/moderation/blocklist-notification.ts index d5d0e5178..eb092a1df 100644 --- a/server/tests/api/moderation/blocklist-notification.ts +++ b/server/tests/api/moderation/blocklist-notification.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { UserNotificationType } from '@shared/models' | 4 | import { UserNotificationType } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -11,8 +11,6 @@ import { | |||
11 | waitJobs | 11 | waitJobs |
12 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | async function checkNotifications (server: PeerTubeServer, token: string, expected: UserNotificationType[]) { | 14 | async function checkNotifications (server: PeerTubeServer, token: string, expected: UserNotificationType[]) { |
17 | const { data } = await server.notifications.list({ token, start: 0, count: 10, unread: true }) | 15 | const { data } = await server.notifications.list({ token, start: 0, count: 10, unread: true }) |
18 | expect(data).to.have.lengthOf(expected.length) | 16 | expect(data).to.have.lengthOf(expected.length) |
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts index ef2c5d7f3..27592e8c5 100644 --- a/server/tests/api/moderation/blocklist.ts +++ b/server/tests/api/moderation/blocklist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { UserNotificationType } from '@shared/models' | 4 | import { UserNotificationType } from '@shared/models' |
5 | import { | 5 | import { |
6 | BlocklistCommand, | 6 | BlocklistCommand, |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | async function checkAllVideos (server: PeerTubeServer, token: string) { | 17 | async function checkAllVideos (server: PeerTubeServer, token: string) { |
20 | { | 18 | { |
21 | const { data } = await server.videos.listWithToken({ token }) | 19 | const { data } = await server.videos.listWithToken({ token }) |
diff --git a/server/tests/api/moderation/video-blacklist.ts b/server/tests/api/moderation/video-blacklist.ts index 68823f97a..ad132aa39 100644 --- a/server/tests/api/moderation/video-blacklist.ts +++ b/server/tests/api/moderation/video-blacklist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { FIXTURE_URLS } from '@server/tests/shared' | 4 | import { FIXTURE_URLS } from '@server/tests/shared' |
5 | import { sortObjectComparator } from '@shared/core-utils' | 5 | import { sortObjectComparator } from '@shared/core-utils' |
6 | import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' | 6 | import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models' |
@@ -16,8 +16,6 @@ import { | |||
16 | waitJobs | 16 | waitJobs |
17 | } from '@shared/server-commands' | 17 | } from '@shared/server-commands' |
18 | 18 | ||
19 | const expect = chai.expect | ||
20 | |||
21 | describe('Test video blacklist', function () { | 19 | describe('Test video blacklist', function () { |
22 | let servers: PeerTubeServer[] = [] | 20 | let servers: PeerTubeServer[] = [] |
23 | let videoId: number | 21 | let videoId: number |
diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts index 7bbec736b..4214687f8 100644 --- a/server/tests/api/notifications/comments-notifications.ts +++ b/server/tests/api/notifications/comments-notifications.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | checkCommentMention, | 5 | checkCommentMention, |
6 | CheckerBaseParams, | 6 | CheckerBaseParams, |
@@ -11,8 +11,6 @@ import { | |||
11 | import { UserNotification } from '@shared/models' | 11 | import { UserNotification } from '@shared/models' |
12 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' | 12 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test comments notifications', function () { | 14 | describe('Test comments notifications', function () { |
17 | let servers: PeerTubeServer[] = [] | 15 | let servers: PeerTubeServer[] = [] |
18 | let userToken: string | 16 | let userToken: string |
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts index e5d883538..f194656c9 100644 --- a/server/tests/api/notifications/notifications-api.ts +++ b/server/tests/api/notifications/notifications-api.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | CheckerBaseParams, | 5 | CheckerBaseParams, |
6 | checkNewVideoFromSubscription, | 6 | checkNewVideoFromSubscription, |
@@ -11,8 +11,6 @@ import { | |||
11 | import { UserNotification, UserNotificationSettingValue } from '@shared/models' | 11 | import { UserNotification, UserNotificationSettingValue } from '@shared/models' |
12 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' | 12 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test notifications API', function () { | 14 | describe('Test notifications API', function () { |
17 | let server: PeerTubeServer | 15 | let server: PeerTubeServer |
18 | let userNotifications: UserNotification[] = [] | 16 | let userNotifications: UserNotification[] = [] |
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts index ca5e15738..c05f3330a 100644 --- a/server/tests/api/notifications/user-notifications.ts +++ b/server/tests/api/notifications/user-notifications.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | CheckerBaseParams, | 5 | CheckerBaseParams, |
6 | checkMyVideoImportIsFinished, | 6 | checkMyVideoImportIsFinished, |
@@ -18,8 +18,6 @@ import { buildUUID } from '@shared/extra-utils' | |||
18 | import { UserNotification, UserNotificationType, VideoPrivacy, VideoStudioTask } from '@shared/models' | 18 | import { UserNotification, UserNotificationType, VideoPrivacy, VideoStudioTask } from '@shared/models' |
19 | import { cleanupTests, findExternalSavedVideo, PeerTubeServer, stopFfmpeg, waitJobs } from '@shared/server-commands' | 19 | import { cleanupTests, findExternalSavedVideo, PeerTubeServer, stopFfmpeg, waitJobs } from '@shared/server-commands' |
20 | 20 | ||
21 | const expect = chai.expect | ||
22 | |||
23 | describe('Test user notifications', function () { | 21 | describe('Test user notifications', function () { |
24 | let servers: PeerTubeServer[] = [] | 22 | let servers: PeerTubeServer[] = [] |
25 | let userAccessToken: string | 23 | let userAccessToken: string |
diff --git a/server/tests/api/object-storage/live.ts b/server/tests/api/object-storage/live.ts index 94fff8f6b..0958ffe0f 100644 --- a/server/tests/api/object-storage/live.ts +++ b/server/tests/api/object-storage/live.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { expectStartWith } from '@server/tests/shared' | 4 | import { expectStartWith } from '@server/tests/shared' |
5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
6 | import { HttpStatusCode, LiveVideoCreate, VideoFile, VideoPrivacy } from '@shared/models' | 6 | import { HttpStatusCode, LiveVideoCreate, VideoFile, VideoPrivacy } from '@shared/models' |
@@ -21,8 +21,6 @@ import { | |||
21 | waitUntilLiveWaitingOnAllServers | 21 | waitUntilLiveWaitingOnAllServers |
22 | } from '@shared/server-commands' | 22 | } from '@shared/server-commands' |
23 | 23 | ||
24 | const expect = chai.expect | ||
25 | |||
26 | async function createLive (server: PeerTubeServer, permanent: boolean) { | 24 | async function createLive (server: PeerTubeServer, permanent: boolean) { |
27 | const attributes: LiveVideoCreate = { | 25 | const attributes: LiveVideoCreate = { |
28 | channelId: server.store.channel.id, | 26 | channelId: server.store.channel.id, |
diff --git a/server/tests/api/object-storage/video-imports.ts b/server/tests/api/object-storage/video-imports.ts index 141ead2f7..f688c7018 100644 --- a/server/tests/api/object-storage/video-imports.ts +++ b/server/tests/api/object-storage/video-imports.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { expectStartWith, FIXTURE_URLS } from '@server/tests/shared' | 4 | import { expectStartWith, FIXTURE_URLS } from '@server/tests/shared' |
5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
6 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | 6 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
@@ -15,8 +15,6 @@ import { | |||
15 | waitJobs | 15 | waitJobs |
16 | } from '@shared/server-commands' | 16 | } from '@shared/server-commands' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | async function importVideo (server: PeerTubeServer) { | 18 | async function importVideo (server: PeerTubeServer) { |
21 | const attributes = { | 19 | const attributes = { |
22 | name: 'import 2', | 20 | name: 'import 2', |
diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.ts index cdb68b962..3e65e1093 100644 --- a/server/tests/api/object-storage/videos.ts +++ b/server/tests/api/object-storage/videos.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 bytes from 'bytes' | 3 | import bytes from 'bytes' |
4 | import * as chai from 'chai' | 4 | import { expect } from 'chai' |
5 | import { stat } from 'fs-extra' | 5 | import { stat } from 'fs-extra' |
6 | import { merge } from 'lodash' | 6 | import { merge } from 'lodash' |
7 | import { | 7 | import { |
@@ -27,8 +27,6 @@ import { | |||
27 | webtorrentAdd | 27 | webtorrentAdd |
28 | } from '@shared/server-commands' | 28 | } from '@shared/server-commands' |
29 | 29 | ||
30 | const expect = chai.expect | ||
31 | |||
32 | async function checkFiles (options: { | 30 | async function checkFiles (options: { |
33 | video: VideoDetails | 31 | video: VideoDetails |
34 | 32 | ||
diff --git a/server/tests/api/redundancy/manage-redundancy.ts b/server/tests/api/redundancy/manage-redundancy.ts index b607900f8..404b65a99 100644 --- a/server/tests/api/redundancy/manage-redundancy.ts +++ b/server/tests/api/redundancy/manage-redundancy.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | cleanupTests, | 5 | cleanupTests, |
6 | createMultipleServers, | 6 | createMultipleServers, |
@@ -12,8 +12,6 @@ import { | |||
12 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
13 | import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models' | 13 | import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test manage videos redundancy', function () { | 15 | describe('Test manage videos redundancy', function () { |
18 | const targets: VideoRedundanciesTarget[] = [ 'my-videos', 'remote-videos' ] | 16 | const targets: VideoRedundanciesTarget[] = [ 'my-videos', 'remote-videos' ] |
19 | 17 | ||
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index cc150e02e..5abed358f 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { readdir } from 'fs-extra' | 4 | import { readdir } from 'fs-extra' |
5 | import magnetUtil from 'magnet-uri' | 5 | import magnetUtil from 'magnet-uri' |
6 | import { basename, join } from 'path' | 6 | import { basename, join } from 'path' |
@@ -25,8 +25,6 @@ import { | |||
25 | waitJobs | 25 | waitJobs |
26 | } from '@shared/server-commands' | 26 | } from '@shared/server-commands' |
27 | 27 | ||
28 | const expect = chai.expect | ||
29 | |||
30 | let servers: PeerTubeServer[] = [] | 28 | let servers: PeerTubeServer[] = [] |
31 | let video1Server2: VideoDetails | 29 | let video1Server2: VideoDetails |
32 | 30 | ||
diff --git a/server/tests/api/search/search-activitypub-video-channels.ts b/server/tests/api/search/search-activitypub-video-channels.ts index 118be11af..06a206d21 100644 --- a/server/tests/api/search/search-activitypub-video-channels.ts +++ b/server/tests/api/search/search-activitypub-video-channels.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideoChannel } from '@shared/models' | 5 | import { VideoChannel } from '@shared/models' |
6 | import { | 6 | import { |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test ActivityPub video channels search', function () { | 17 | describe('Test ActivityPub video channels search', function () { |
20 | let servers: PeerTubeServer[] | 18 | let servers: PeerTubeServer[] |
21 | let userServer2Token: string | 19 | let userServer2Token: string |
diff --git a/server/tests/api/search/search-activitypub-video-playlists.ts b/server/tests/api/search/search-activitypub-video-playlists.ts index 1ba9ce2c4..25b162074 100644 --- a/server/tests/api/search/search-activitypub-video-playlists.ts +++ b/server/tests/api/search/search-activitypub-video-playlists.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideoPlaylistPrivacy } from '@shared/models' | 5 | import { VideoPlaylistPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test ActivityPub playlists search', function () { | 17 | describe('Test ActivityPub playlists search', function () { |
20 | let servers: PeerTubeServer[] | 18 | let servers: PeerTubeServer[] |
21 | let playlistServer1UUID: string | 19 | let playlistServer1UUID: string |
diff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.ts index b17b92dca..4c7118422 100644 --- a/server/tests/api/search/search-activitypub-videos.ts +++ b/server/tests/api/search/search-activitypub-videos.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideoPrivacy } from '@shared/models' | 5 | import { VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test ActivityPub videos search', function () { | 17 | describe('Test ActivityPub videos search', function () { |
20 | let servers: PeerTubeServer[] | 18 | let servers: PeerTubeServer[] |
21 | let videoServer1UUID: string | 19 | let videoServer1UUID: string |
diff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.ts index cab8e6292..c6b098a93 100644 --- a/server/tests/api/search/search-channels.ts +++ b/server/tests/api/search/search-channels.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { VideoChannel } from '@shared/models' | 4 | import { VideoChannel } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -13,8 +13,6 @@ import { | |||
13 | setDefaultChannelAvatar | 13 | setDefaultChannelAvatar |
14 | } from '@shared/server-commands' | 14 | } from '@shared/server-commands' |
15 | 15 | ||
16 | const expect = chai.expect | ||
17 | |||
18 | describe('Test channels search', function () { | 16 | describe('Test channels search', function () { |
19 | let server: PeerTubeServer | 17 | let server: PeerTubeServer |
20 | let remoteServer: PeerTubeServer | 18 | let remoteServer: PeerTubeServer |
diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.ts index ece6c0475..c61ac441d 100644 --- a/server/tests/api/search/search-index.ts +++ b/server/tests/api/search/search-index.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | BooleanBothQuery, | 5 | BooleanBothQuery, |
6 | VideoChannelsSearchQuery, | 6 | VideoChannelsSearchQuery, |
@@ -11,8 +11,6 @@ import { | |||
11 | } from '@shared/models' | 11 | } from '@shared/models' |
12 | import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/server-commands' | 12 | import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test index search', function () { | 14 | describe('Test index search', function () { |
17 | const localVideoName = 'local video' + new Date().toISOString() | 15 | const localVideoName = 'local video' + new Date().toISOString() |
18 | 16 | ||
diff --git a/server/tests/api/search/search-playlists.ts b/server/tests/api/search/search-playlists.ts index 8d48de641..a357674c2 100644 --- a/server/tests/api/search/search-playlists.ts +++ b/server/tests/api/search/search-playlists.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { VideoPlaylistPrivacy } from '@shared/models' | 4 | import { VideoPlaylistPrivacy } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -14,8 +14,6 @@ import { | |||
14 | setDefaultVideoChannel | 14 | setDefaultVideoChannel |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test playlists search', function () { | 17 | describe('Test playlists search', function () { |
20 | let server: PeerTubeServer | 18 | let server: PeerTubeServer |
21 | let remoteServer: PeerTubeServer | 19 | let remoteServer: PeerTubeServer |
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index 5f2da55e2..5e85e3aa7 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideoPrivacy } from '@shared/models' | 5 | import { VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -16,8 +16,6 @@ import { | |||
16 | stopFfmpeg | 16 | stopFfmpeg |
17 | } from '@shared/server-commands' | 17 | } from '@shared/server-commands' |
18 | 18 | ||
19 | const expect = chai.expect | ||
20 | |||
21 | describe('Test videos search', function () { | 19 | describe('Test videos search', function () { |
22 | let server: PeerTubeServer | 20 | let server: PeerTubeServer |
23 | let remoteServer: PeerTubeServer | 21 | let remoteServer: PeerTubeServer |
diff --git a/server/tests/api/server/auto-follows.ts b/server/tests/api/server/auto-follows.ts index 9666e61dd..cdaadb3ad 100644 --- a/server/tests/api/server/auto-follows.ts +++ b/server/tests/api/server/auto-follows.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { MockInstancesIndex } from '@server/tests/shared' | 4 | import { MockInstancesIndex } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | 6 | import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | async function checkFollow (follower: PeerTubeServer, following: PeerTubeServer, exists: boolean) { | 8 | async function checkFollow (follower: PeerTubeServer, following: PeerTubeServer, exists: boolean) { |
11 | { | 9 | { |
12 | const body = await following.follows.getFollowers({ start: 0, count: 5, sort: '-createdAt' }) | 10 | const body = await following.follows.getFollowers({ start: 0, count: 5, sort: '-createdAt' }) |
diff --git a/server/tests/api/server/bulk.ts b/server/tests/api/server/bulk.ts index 560dcc76e..05762c7c2 100644 --- a/server/tests/api/server/bulk.ts +++ b/server/tests/api/server/bulk.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | BulkCommand, | 5 | BulkCommand, |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -11,8 +11,6 @@ import { | |||
11 | waitJobs | 11 | waitJobs |
12 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test bulk actions', function () { | 14 | describe('Test bulk actions', function () { |
17 | const commentsUser3: { videoId: number, commentId: number }[] = [] | 15 | const commentsUser3: { videoId: number, commentId: number }[] = [] |
18 | 16 | ||
diff --git a/server/tests/api/server/config-defaults.ts b/server/tests/api/server/config-defaults.ts index 47ee4746d..4fa37d0e2 100644 --- a/server/tests/api/server/config-defaults.ts +++ b/server/tests/api/server/config-defaults.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { FIXTURE_URLS } from '@server/tests/shared' | 4 | import { FIXTURE_URLS } from '@server/tests/shared' |
5 | import { VideoDetails, VideoPrivacy } from '@shared/models' | 5 | import { VideoDetails, VideoPrivacy } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' | 6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test config defaults', function () { | 8 | describe('Test config defaults', function () { |
11 | let server: PeerTubeServer | 9 | let server: PeerTubeServer |
12 | let channelId: number | 10 | let channelId: number |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 2b2b093a7..b8c99e804 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { parallelTests } from '@shared/core-utils' | 4 | import { parallelTests } from '@shared/core-utils' |
5 | import { CustomConfig, HttpStatusCode } from '@shared/models' | 5 | import { CustomConfig, HttpStatusCode } from '@shared/models' |
6 | import { | 6 | import { |
@@ -12,8 +12,6 @@ import { | |||
12 | setAccessTokensToServers | 12 | setAccessTokensToServers |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { | 15 | function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { |
18 | expect(data.instance.name).to.equal('PeerTube') | 16 | expect(data.instance.name).to.equal('PeerTube') |
19 | expect(data.instance.shortDescription).to.equal( | 17 | expect(data.instance.shortDescription).to.equal( |
diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts index 3eb6c8548..fcd7f3c4c 100644 --- a/server/tests/api/server/contact-form.ts +++ b/server/tests/api/server/contact-form.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { MockSmtpServer } from '@server/tests/shared' | 4 | import { MockSmtpServer } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { HttpStatusCode } from '@shared/models' | 6 | import { HttpStatusCode } from '@shared/models' |
@@ -13,8 +13,6 @@ import { | |||
13 | waitJobs | 13 | waitJobs |
14 | } from '@shared/server-commands' | 14 | } from '@shared/server-commands' |
15 | 15 | ||
16 | const expect = chai.expect | ||
17 | |||
18 | describe('Test contact form', function () { | 16 | describe('Test contact form', function () { |
19 | let server: PeerTubeServer | 17 | let server: PeerTubeServer |
20 | const emails: object[] = [] | 18 | const emails: object[] = [] |
diff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.ts index 5ac66225f..1826c268a 100644 --- a/server/tests/api/server/email.ts +++ b/server/tests/api/server/email.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { MockSmtpServer } from '@server/tests/shared' | 4 | import { MockSmtpServer } from '@server/tests/shared' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | 6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test emails', function () { | 8 | describe('Test emails', function () { |
11 | let server: PeerTubeServer | 9 | let server: PeerTubeServer |
12 | let userId: number | 10 | let userId: number |
diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.ts index c5c8c8595..5998f58cc 100644 --- a/server/tests/api/server/follow-constraints.ts +++ b/server/tests/api/server/follow-constraints.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 4 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
5 | import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' | 5 | import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' |
6 | 6 | ||
7 | const expect = chai.expect | ||
8 | |||
9 | describe('Test follow constraints', function () { | 7 | describe('Test follow constraints', function () { |
10 | let servers: PeerTubeServer[] = [] | 8 | let servers: PeerTubeServer[] = [] |
11 | let video1UUID: string | 9 | let video1UUID: string |
diff --git a/server/tests/api/server/follows-moderation.ts b/server/tests/api/server/follows-moderation.ts index dc189fec5..deeaac85a 100644 --- a/server/tests/api/server/follows-moderation.ts +++ b/server/tests/api/server/follows-moderation.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { expectStartWith } from '@server/tests/shared' | 4 | import { expectStartWith } from '@server/tests/shared' |
5 | import { ActorFollow, FollowState } from '@shared/models' | 5 | import { ActorFollow, FollowState } from '@shared/models' |
6 | import { | 6 | import { |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | async function checkServer1And2HasFollowers (servers: PeerTubeServer[], state = 'accepted') { | 15 | async function checkServer1And2HasFollowers (servers: PeerTubeServer[], state = 'accepted') { |
18 | const fns = [ | 16 | const fns = [ |
19 | servers[0].follows.getFollowings.bind(servers[0].follows), | 17 | servers[0].follows.getFollowings.bind(servers[0].follows), |
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index 3ff8c3583..96d39352b 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { completeVideoCheck, dateIsValid, expectAccountFollows, expectChannelsFollows, testCaptionFile } from '@server/tests/shared' | 4 | import { completeVideoCheck, dateIsValid, expectAccountFollows, expectChannelsFollows, testCaptionFile } from '@server/tests/shared' |
5 | import { VideoCreateResult, VideoPrivacy } from '@shared/models' | 5 | import { VideoCreateResult, VideoPrivacy } from '@shared/models' |
6 | import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | 6 | import { cleanupTests, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test follows', function () { | 8 | describe('Test follows', function () { |
11 | let servers: PeerTubeServer[] = [] | 9 | let servers: PeerTubeServer[] = [] |
12 | 10 | ||
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index 78b3f8560..9ace65ddf 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { completeVideoCheck } from '@server/tests/shared' | 4 | import { completeVideoCheck } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models' | 6 | import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models' |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test handle downs', function () { | 17 | describe('Test handle downs', function () { |
20 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
21 | let threadIdServer1: number | 19 | let threadIdServer1: number |
diff --git a/server/tests/api/server/homepage.ts b/server/tests/api/server/homepage.ts index 1867826d6..9c45800f2 100644 --- a/server/tests/api/server/homepage.ts +++ b/server/tests/api/server/homepage.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -13,8 +13,6 @@ import { | |||
13 | setDefaultChannelAvatar | 13 | setDefaultChannelAvatar |
14 | } from '../../../../shared/server-commands/index' | 14 | } from '../../../../shared/server-commands/index' |
15 | 15 | ||
16 | const expect = chai.expect | ||
17 | |||
18 | async function getHomepageState (server: PeerTubeServer) { | 16 | async function getHomepageState (server: PeerTubeServer) { |
19 | const config = await server.config.getConfig() | 17 | const config = await server.config.getConfig() |
20 | 18 | ||
diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts index 8217da19b..211e32b1e 100644 --- a/server/tests/api/server/jobs.ts +++ b/server/tests/api/server/jobs.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { dateIsValid } from '@server/tests/shared' | 4 | import { dateIsValid } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { | 6 | import { |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test jobs', function () { | 15 | describe('Test jobs', function () { |
18 | let servers: PeerTubeServer[] | 16 | let servers: PeerTubeServer[] |
19 | 17 | ||
diff --git a/server/tests/api/server/logs.ts b/server/tests/api/server/logs.ts index 8e626c9df..3b3314d34 100644 --- a/server/tests/api/server/logs.ts +++ b/server/tests/api/server/logs.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test logs', function () { | 15 | describe('Test logs', function () { |
18 | let server: PeerTubeServer | 16 | let server: PeerTubeServer |
19 | let logsCommand: LogsCommand | 17 | let logsCommand: LogsCommand |
diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts index fbcf4651e..8ac7023eb 100644 --- a/server/tests/api/server/plugins.ts +++ b/server/tests/api/server/plugins.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { pathExists, remove } from 'fs-extra' | 4 | import { pathExists, remove } from 'fs-extra' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { testHelloWorldRegisteredSettings } from '@server/tests/shared' | 6 | import { testHelloWorldRegisteredSettings } from '@server/tests/shared' |
@@ -16,8 +16,6 @@ import { | |||
16 | setAccessTokensToServers | 16 | setAccessTokensToServers |
17 | } from '@shared/server-commands' | 17 | } from '@shared/server-commands' |
18 | 18 | ||
19 | const expect = chai.expect | ||
20 | |||
21 | describe('Test plugins', function () { | 19 | describe('Test plugins', function () { |
22 | let server: PeerTubeServer = null | 20 | let server: PeerTubeServer = null |
23 | let command: PluginsCommand | 21 | let command: PluginsCommand |
diff --git a/server/tests/api/server/proxy.ts b/server/tests/api/server/proxy.ts index 851bed058..a4151ebdd 100644 --- a/server/tests/api/server/proxy.ts +++ b/server/tests/api/server/proxy.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { expectNotStartWith, expectStartWith, FIXTURE_URLS, MockProxy } from '@server/tests/shared' | 4 | import { expectNotStartWith, expectStartWith, FIXTURE_URLS, MockProxy } from '@server/tests/shared' |
5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
6 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | 6 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
@@ -15,8 +15,6 @@ import { | |||
15 | waitJobs | 15 | waitJobs |
16 | } from '@shared/server-commands' | 16 | } from '@shared/server-commands' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | describe('Test proxy', function () { | 18 | describe('Test proxy', function () { |
21 | let servers: PeerTubeServer[] = [] | 19 | let servers: PeerTubeServer[] = [] |
22 | let proxy: MockProxy | 20 | let proxy: MockProxy |
diff --git a/server/tests/api/server/services.ts b/server/tests/api/server/services.ts index ed7aca6b6..380308a34 100644 --- a/server/tests/api/server/services.ts +++ b/server/tests/api/server/services.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' | 4 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' |
5 | import { Video, VideoPlaylistPrivacy } from '@shared/models' | 5 | import { Video, VideoPlaylistPrivacy } from '@shared/models' |
6 | 6 | ||
7 | const expect = chai.expect | ||
8 | |||
9 | describe('Test services', function () { | 7 | describe('Test services', function () { |
10 | let server: PeerTubeServer = null | 8 | let server: PeerTubeServer = null |
11 | let playlistUUID: string | 9 | let playlistUUID: string |
diff --git a/server/tests/api/server/slow-follows.ts b/server/tests/api/server/slow-follows.ts index 73ac26bf8..a967fa724 100644 --- a/server/tests/api/server/slow-follows.ts +++ b/server/tests/api/server/slow-follows.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { Job } from '@shared/models' | 4 | import { Job } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -11,8 +11,6 @@ import { | |||
11 | waitJobs | 11 | waitJobs |
12 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test slow follows', function () { | 14 | describe('Test slow follows', function () { |
17 | let servers: PeerTubeServer[] = [] | 15 | let servers: PeerTubeServer[] = [] |
18 | 16 | ||
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index 6dad22aa1..762fc422d 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { ActivityType, VideoPlaylistPrivacy } from '@shared/models' | 5 | import { ActivityType, VideoPlaylistPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test stats (excluding redundancy)', function () { | 17 | describe('Test stats (excluding redundancy)', function () { |
20 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
21 | let channelId | 19 | let channelId |
diff --git a/server/tests/api/transcoding/audio-only.ts b/server/tests/api/transcoding/audio-only.ts index da1d50eb2..1897c6d6d 100644 --- a/server/tests/api/transcoding/audio-only.ts +++ b/server/tests/api/transcoding/audio-only.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { getAudioStream, getVideoStreamDimensionsInfo } from '@server/helpers/ffmpeg' | 4 | import { getAudioStream, getVideoStreamDimensionsInfo } from '@server/helpers/ffmpeg' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -11,8 +11,6 @@ import { | |||
11 | waitJobs | 11 | waitJobs |
12 | } from '@shared/server-commands' | 12 | } from '@shared/server-commands' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test audio only video transcoding', function () { | 14 | describe('Test audio only video transcoding', function () { |
17 | let servers: PeerTubeServer[] = [] | 15 | let servers: PeerTubeServer[] = [] |
18 | let videoUUID: string | 16 | let videoUUID: string |
diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.ts index e1972f275..a50bf7654 100644 --- a/server/tests/api/transcoding/create-transcoding.ts +++ b/server/tests/api/transcoding/create-transcoding.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { checkResolutionsInMasterPlaylist, expectStartWith } from '@server/tests/shared' | 4 | import { checkResolutionsInMasterPlaylist, expectStartWith } from '@server/tests/shared' |
5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 5 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
6 | import { HttpStatusCode, VideoDetails } from '@shared/models' | 6 | import { HttpStatusCode, VideoDetails } from '@shared/models' |
@@ -17,8 +17,6 @@ import { | |||
17 | waitJobs | 17 | waitJobs |
18 | } from '@shared/server-commands' | 18 | } from '@shared/server-commands' |
19 | 19 | ||
20 | const expect = chai.expect | ||
21 | |||
22 | async function checkFilesInObjectStorage (video: VideoDetails) { | 20 | async function checkFilesInObjectStorage (video: VideoDetails) { |
23 | for (const file of video.files) { | 21 | for (const file of video.files) { |
24 | expectStartWith(file.fileUrl, ObjectStorageCommand.getWebTorrentBaseUrl()) | 22 | expectStartWith(file.fileUrl, ObjectStorageCommand.getWebTorrentBaseUrl()) |
diff --git a/server/tests/api/transcoding/hls.ts b/server/tests/api/transcoding/hls.ts index a7ac97e0a..252422e5d 100644 --- a/server/tests/api/transcoding/hls.ts +++ b/server/tests/api/transcoding/hls.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { basename, join } from 'path' | 4 | import { basename, join } from 'path' |
5 | import { | 5 | import { |
6 | checkDirectoryIsEmpty, | 6 | checkDirectoryIsEmpty, |
@@ -25,8 +25,6 @@ import { | |||
25 | } from '@shared/server-commands' | 25 | } from '@shared/server-commands' |
26 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' | 26 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' |
27 | 27 | ||
28 | const expect = chai.expect | ||
29 | |||
30 | async function checkHlsPlaylist (options: { | 28 | async function checkHlsPlaylist (options: { |
31 | servers: PeerTubeServer[] | 29 | servers: PeerTubeServer[] |
32 | videoUUID: string | 30 | videoUUID: string |
diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts index c024fa75c..894a49f98 100644 --- a/server/tests/api/users/user-subscriptions.ts +++ b/server/tests/api/users/user-subscriptions.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { VideoPrivacy } from '@shared/models' | 4 | import { VideoPrivacy } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test users subscriptions', function () { | 17 | describe('Test users subscriptions', function () { |
20 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
21 | const users: { accessToken: string }[] = [] | 19 | const users: { accessToken: string }[] = [] |
diff --git a/server/tests/api/users/user-videos.ts b/server/tests/api/users/user-videos.ts index 87040d2e4..4343c1e49 100644 --- a/server/tests/api/users/user-videos.ts +++ b/server/tests/api/users/user-videos.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test user videos', function () { | 15 | describe('Test user videos', function () { |
18 | let server: PeerTubeServer | 16 | let server: PeerTubeServer |
19 | let videoId: number | 17 | let videoId: number |
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index d1b9f76f9..62d668d1e 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | checkActorFilesWereRemoved, | 5 | checkActorFilesWereRemoved, |
6 | checkTmpIsEmpty, | 6 | checkTmpIsEmpty, |
@@ -19,8 +19,6 @@ import { | |||
19 | waitJobs | 19 | waitJobs |
20 | } from '@shared/server-commands' | 20 | } from '@shared/server-commands' |
21 | 21 | ||
22 | const expect = chai.expect | ||
23 | |||
24 | describe('Test users with multiple servers', function () { | 22 | describe('Test users with multiple servers', function () { |
25 | let servers: PeerTubeServer[] = [] | 23 | let servers: PeerTubeServer[] = [] |
26 | 24 | ||
diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts index 3d657f73e..fc082383a 100644 --- a/server/tests/api/users/users-verification.ts +++ b/server/tests/api/users/users-verification.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { MockSmtpServer } from '@server/tests/shared' | 4 | import { MockSmtpServer } from '@server/tests/shared' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | 6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test users account verification', function () { | 8 | describe('Test users account verification', function () { |
11 | let server: PeerTubeServer | 9 | let server: PeerTubeServer |
12 | let userId: number | 10 | let userId: number |
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 3fd68cfe6..9e657b387 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { testImage } from '@server/tests/shared' | 4 | import { testImage } from '@server/tests/shared' |
5 | import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, VideoPlaylistType } from '@shared/models' | 5 | import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, VideoPlaylistType } from '@shared/models' |
6 | import { | 6 | import { |
@@ -12,8 +12,6 @@ import { | |||
12 | setAccessTokensToServers | 12 | setAccessTokensToServers |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test users', function () { | 15 | describe('Test users', function () { |
18 | let server: PeerTubeServer | 16 | let server: PeerTubeServer |
19 | let token: string | 17 | let token: string |
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 766cc8236..23790ba65 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import request from 'supertest' | 4 | import request from 'supertest' |
5 | import { | 5 | import { |
6 | checkTmpIsEmpty, | 6 | checkTmpIsEmpty, |
@@ -25,8 +25,6 @@ import { | |||
25 | webtorrentAdd | 25 | webtorrentAdd |
26 | } from '@shared/server-commands' | 26 | } from '@shared/server-commands' |
27 | 27 | ||
28 | const expect = chai.expect | ||
29 | |||
30 | describe('Test multiple servers', function () { | 28 | describe('Test multiple servers', function () { |
31 | let servers: PeerTubeServer[] = [] | 29 | let servers: PeerTubeServer[] = [] |
32 | const toRemove = [] | 30 | const toRemove = [] |
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts index 9936d5467..0625828a1 100644 --- a/server/tests/api/videos/resumable-upload.ts +++ b/server/tests/api/videos/resumable-upload.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { pathExists, readdir, stat } from 'fs-extra' | 4 | import { pathExists, readdir, stat } from 'fs-extra' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | 6 | import { buildAbsoluteFixturePath } from '@shared/core-utils' |
@@ -8,8 +8,6 @@ import { sha1 } from '@shared/extra-utils' | |||
8 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | 8 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
9 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' | 9 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/server-commands' |
10 | 10 | ||
11 | const expect = chai.expect | ||
12 | |||
13 | // Most classic resumable upload tests are done in other test suites | 11 | // Most classic resumable upload tests are done in other test suites |
14 | 12 | ||
15 | describe('Test resumable upload', function () { | 13 | describe('Test resumable upload', function () { |
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index 574fb523e..da8bde07b 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { checkVideoFilesWereRemoved, completeVideoCheck, testImage } from '@server/tests/shared' | 4 | import { checkVideoFilesWereRemoved, completeVideoCheck, testImage } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { Video, VideoPrivacy } from '@shared/models' | 6 | import { Video, VideoPrivacy } from '@shared/models' |
@@ -14,8 +14,6 @@ import { | |||
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test a single server', function () { | 17 | describe('Test a single server', function () { |
20 | 18 | ||
21 | function runSuite (mode: 'legacy' | 'resumable') { | 19 | function runSuite (mode: 'legacy' | 'resumable') { |
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts index b68e5e6e8..0630c9d3a 100644 --- a/server/tests/api/videos/video-captions.ts +++ b/server/tests/api/videos/video-captions.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { checkVideoFilesWereRemoved, testCaptionFile } from '@server/tests/shared' | 4 | import { checkVideoFilesWereRemoved, testCaptionFile } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { | 6 | import { |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test video captions', function () { | 15 | describe('Test video captions', function () { |
18 | const uuidRegex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' | 16 | const uuidRegex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' |
19 | 17 | ||
diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts index 85bc191b6..e9ef67493 100644 --- a/server/tests/api/videos/video-change-ownership.ts +++ b/server/tests/api/videos/video-change-ownership.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | ChangeOwnershipCommand, | 5 | ChangeOwnershipCommand, |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -14,8 +14,6 @@ import { | |||
14 | } from '@shared/server-commands' | 14 | } from '@shared/server-commands' |
15 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | 15 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
16 | 16 | ||
17 | const expect = chai.expect | ||
18 | |||
19 | describe('Test video change ownership - nominal', function () { | 17 | describe('Test video change ownership - nominal', function () { |
20 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
21 | 19 | ||
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index b7645ea59..86a8a038c 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { basename } from 'path' | 4 | import { basename } from 'path' |
5 | import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' | 5 | import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' |
6 | import { testFileExistsOrNot, testImage } from '@server/tests/shared' | 6 | import { testFileExistsOrNot, testImage } from '@server/tests/shared' |
@@ -17,8 +17,6 @@ import { | |||
17 | waitJobs | 17 | waitJobs |
18 | } from '@shared/server-commands' | 18 | } from '@shared/server-commands' |
19 | 19 | ||
20 | const expect = chai.expect | ||
21 | |||
22 | async function findChannel (server: PeerTubeServer, channelId: number) { | 20 | async function findChannel (server: PeerTubeServer, channelId: number) { |
23 | const body = await server.channels.list({ sort: '-name' }) | 21 | const body = await server.channels.list({ sort: '-name' }) |
24 | 22 | ||
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index 6d74a865f..348b408e8 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { dateIsValid, testImage } from '@server/tests/shared' | 4 | import { dateIsValid, testImage } from '@server/tests/shared' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -12,8 +12,6 @@ import { | |||
12 | setDefaultChannelAvatar | 12 | setDefaultChannelAvatar |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test video comments', function () { | 15 | describe('Test video comments', function () { |
18 | let server: PeerTubeServer | 16 | let server: PeerTubeServer |
19 | let videoId: number | 17 | let videoId: number |
diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts index 347325741..a74b78a5f 100644 --- a/server/tests/api/videos/video-description.ts +++ b/server/tests/api/videos/video-description.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | cleanupTests, | 5 | cleanupTests, |
6 | createMultipleServers, | 6 | createMultipleServers, |
@@ -10,8 +10,6 @@ import { | |||
10 | waitJobs | 10 | waitJobs |
11 | } from '@shared/server-commands' | 11 | } from '@shared/server-commands' |
12 | 12 | ||
13 | const expect = chai.expect | ||
14 | |||
15 | describe('Test video description', function () { | 13 | describe('Test video description', function () { |
16 | let servers: PeerTubeServer[] = [] | 14 | let servers: PeerTubeServer[] = [] |
17 | let videoUUID = '' | 15 | let videoUUID = '' |
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index cfa130043..65e9c8730 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 4 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
5 | import { BooleanBothQuery, CustomConfig, ResultList, Video, VideosOverview } from '@shared/models' | 5 | import { BooleanBothQuery, CustomConfig, ResultList, Video, VideosOverview } from '@shared/models' |
6 | 6 | ||
7 | const expect = chai.expect | ||
8 | |||
9 | function createOverviewRes (overview: VideosOverview) { | 7 | function createOverviewRes (overview: VideosOverview) { |
10 | const videos = overview.categories[0].videos | 8 | const videos = overview.categories[0].videos |
11 | return { data: videos, total: videos.length } | 9 | return { data: videos, total: videos.length } |
diff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.ts index 019f34b6b..356939b93 100644 --- a/server/tests/api/videos/video-playlist-thumbnails.ts +++ b/server/tests/api/videos/video-playlist-thumbnails.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { testImage } from '@server/tests/shared' | 4 | import { testImage } from '@server/tests/shared' |
5 | import { VideoPlaylistPrivacy } from '@shared/models' | 5 | import { VideoPlaylistPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -13,8 +13,6 @@ import { | |||
13 | waitJobs | 13 | waitJobs |
14 | } from '@shared/server-commands' | 14 | } from '@shared/server-commands' |
15 | 15 | ||
16 | const expect = chai.expect | ||
17 | |||
18 | describe('Playlist thumbnail', function () { | 16 | describe('Playlist thumbnail', function () { |
19 | let servers: PeerTubeServer[] = [] | 17 | let servers: PeerTubeServer[] = [] |
20 | 18 | ||
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index dd5f6a3ca..47b8c7b1e 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { checkPlaylistFilesWereRemoved, testImage } from '@server/tests/shared' | 4 | import { checkPlaylistFilesWereRemoved, testImage } from '@server/tests/shared' |
5 | import { wait } from '@shared/core-utils' | 5 | import { wait } from '@shared/core-utils' |
6 | import { | 6 | import { |
@@ -24,8 +24,6 @@ import { | |||
24 | waitJobs | 24 | waitJobs |
25 | } from '@shared/server-commands' | 25 | } from '@shared/server-commands' |
26 | 26 | ||
27 | const expect = chai.expect | ||
28 | |||
29 | async function checkPlaylistElementType ( | 27 | async function checkPlaylistElementType ( |
30 | servers: PeerTubeServer[], | 28 | servers: PeerTubeServer[], |
31 | playlistId: string, | 29 | playlistId: string, |
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index 711622df9..b18c71c94 100644 --- a/server/tests/api/videos/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' | 5 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | 6 | import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test video privacy', function () { | 8 | describe('Test video privacy', function () { |
11 | const servers: PeerTubeServer[] = [] | 9 | const servers: PeerTubeServer[] = [] |
12 | let anotherUserToken: string | 10 | let anotherUserToken: string |
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts index 7865b3439..73f1519d9 100644 --- a/server/tests/api/videos/video-schedule-update.ts +++ b/server/tests/api/videos/video-schedule-update.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideoPrivacy } from '@shared/models' | 5 | import { VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | function in10Seconds () { | 15 | function in10Seconds () { |
18 | const now = new Date() | 16 | const now = new Date() |
19 | now.setSeconds(now.getSeconds() + 10) | 17 | now.setSeconds(now.getSeconds() + 10) |
diff --git a/server/tests/api/videos/video-source.ts b/server/tests/api/videos/video-source.ts index 4c1641ed0..5ecf8316f 100644 --- a/server/tests/api/videos/video-source.ts +++ b/server/tests/api/videos/video-source.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import * as chai from 'chai' | 1 | import { expect } from 'chai' |
2 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 2 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
3 | 3 | ||
4 | const expect = chai.expect | ||
5 | |||
6 | describe('Test video source', () => { | 4 | describe('Test video source', () => { |
7 | let server: PeerTubeServer = null | 5 | let server: PeerTubeServer = null |
8 | const fixture = 'video_short.webm' | 6 | const fixture = 'video_short.webm' |
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts index 500744e40..6df26ab7d 100644 --- a/server/tests/api/videos/videos-history.ts +++ b/server/tests/api/videos/videos-history.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { Video } from '@shared/models' | 5 | import { Video } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 6 | import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test videos history', function () { | 8 | describe('Test videos history', function () { |
11 | let server: PeerTubeServer = null | 9 | let server: PeerTubeServer = null |
12 | let video1Id: number | 10 | let video1Id: number |
diff --git a/server/tests/api/videos/videos-overview.ts b/server/tests/api/videos/videos-overview.ts index 5159e8248..c012d47c3 100644 --- a/server/tests/api/videos/videos-overview.ts +++ b/server/tests/api/videos/videos-overview.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { VideosOverview } from '@shared/models' | 5 | import { VideosOverview } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 6 | import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test a videos overview', function () { | 8 | describe('Test a videos overview', function () { |
11 | let server: PeerTubeServer = null | 9 | let server: PeerTubeServer = null |
12 | 10 | ||
diff --git a/server/tests/api/views/video-views-counter.ts b/server/tests/api/views/video-views-counter.ts index 9ade1dc0c..ca33ff9cd 100644 --- a/server/tests/api/views/video-views-counter.ts +++ b/server/tests/api/views/video-views-counter.ts | |||
@@ -1,13 +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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { FfmpegCommand } from 'fluent-ffmpeg' | 4 | import { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { prepareViewsServers, prepareViewsVideos, processViewsBuffer } from '@server/tests/shared' | 5 | import { prepareViewsServers, prepareViewsVideos, processViewsBuffer } from '@server/tests/shared' |
6 | import { wait } from '@shared/core-utils' | 6 | import { wait } from '@shared/core-utils' |
7 | import { cleanupTests, PeerTubeServer, stopFfmpeg, waitJobs } from '@shared/server-commands' | 7 | import { cleanupTests, PeerTubeServer, stopFfmpeg, waitJobs } from '@shared/server-commands' |
8 | 8 | ||
9 | const expect = chai.expect | ||
10 | |||
11 | describe('Test video views/viewers counters', function () { | 9 | describe('Test video views/viewers counters', function () { |
12 | let servers: PeerTubeServer[] | 10 | let servers: PeerTubeServer[] |
13 | 11 | ||
diff --git a/server/tests/api/views/video-views-overall-stats.ts b/server/tests/api/views/video-views-overall-stats.ts index b21d70c0b..bb00684ef 100644 --- a/server/tests/api/views/video-views-overall-stats.ts +++ b/server/tests/api/views/video-views-overall-stats.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { FfmpegCommand } from 'fluent-ffmpeg' | 4 | import { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { prepareViewsServers, prepareViewsVideos, processViewersStats } from '@server/tests/shared' | 5 | import { prepareViewsServers, prepareViewsVideos, processViewersStats } from '@server/tests/shared' |
6 | import { cleanupTests, PeerTubeServer, stopFfmpeg, waitJobs } from '@shared/server-commands' | 6 | import { cleanupTests, PeerTubeServer, stopFfmpeg, waitJobs } from '@shared/server-commands' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test views overall stats', function () { | 8 | describe('Test views overall stats', function () { |
11 | let servers: PeerTubeServer[] | 9 | let servers: PeerTubeServer[] |
12 | 10 | ||
diff --git a/server/tests/api/views/video-views-retention-stats.ts b/server/tests/api/views/video-views-retention-stats.ts index 307d6de07..621b05110 100644 --- a/server/tests/api/views/video-views-retention-stats.ts +++ b/server/tests/api/views/video-views-retention-stats.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { prepareViewsServers, prepareViewsVideos, processViewersStats } from '@server/tests/shared' | 4 | import { prepareViewsServers, prepareViewsVideos, processViewersStats } from '@server/tests/shared' |
5 | import { cleanupTests, PeerTubeServer } from '@shared/server-commands' | 5 | import { cleanupTests, PeerTubeServer } from '@shared/server-commands' |
6 | 6 | ||
7 | const expect = chai.expect | ||
8 | |||
9 | describe('Test views retention stats', function () { | 7 | describe('Test views retention stats', function () { |
10 | let servers: PeerTubeServer[] | 8 | let servers: PeerTubeServer[] |
11 | 9 | ||
diff --git a/server/tests/api/views/video-views-timeserie-stats.ts b/server/tests/api/views/video-views-timeserie-stats.ts index d6c89a63e..e8cb34ad6 100644 --- a/server/tests/api/views/video-views-timeserie-stats.ts +++ b/server/tests/api/views/video-views-timeserie-stats.ts | |||
@@ -1,13 +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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { FfmpegCommand } from 'fluent-ffmpeg' | 4 | import { FfmpegCommand } from 'fluent-ffmpeg' |
5 | import { prepareViewsServers, prepareViewsVideos, processViewersStats } from '@server/tests/shared' | 5 | import { prepareViewsServers, prepareViewsVideos, processViewersStats } from '@server/tests/shared' |
6 | import { VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@shared/models' | 6 | import { VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@shared/models' |
7 | import { cleanupTests, PeerTubeServer, stopFfmpeg } from '@shared/server-commands' | 7 | import { cleanupTests, PeerTubeServer, stopFfmpeg } from '@shared/server-commands' |
8 | 8 | ||
9 | const expect = chai.expect | ||
10 | |||
11 | function buildOneMonthAgo () { | 9 | function buildOneMonthAgo () { |
12 | const monthAgo = new Date() | 10 | const monthAgo = new Date() |
13 | monthAgo.setHours(0, 0, 0, 0) | 11 | monthAgo.setHours(0, 0, 0, 0) |
diff --git a/server/tests/api/views/videos-views-cleaner.ts b/server/tests/api/views/videos-views-cleaner.ts index e28f82668..7c543a74a 100644 --- a/server/tests/api/views/videos-views-cleaner.ts +++ b/server/tests/api/views/videos-views-cleaner.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { wait } from '@shared/core-utils' | 4 | import { wait } from '@shared/core-utils' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -12,8 +12,6 @@ import { | |||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
15 | const expect = chai.expect | ||
16 | |||
17 | describe('Test video views cleaner', function () { | 15 | describe('Test video views cleaner', function () { |
18 | let servers: PeerTubeServer[] | 16 | let servers: PeerTubeServer[] |
19 | 17 | ||
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts index aa24e6996..2cf2dd8f8 100644 --- a/server/tests/cli/create-import-video-file-job.ts +++ b/server/tests/cli/create-import-video-file-job.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
5 | import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models' | 5 | import { HttpStatusCode, VideoDetails, VideoFile, VideoInclude } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | import { expectStartWith } from '../shared' | 16 | import { expectStartWith } from '../shared' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | function assertVideoProperties (video: VideoFile, resolution: number, extname: string, size?: number) { | 18 | function assertVideoProperties (video: VideoFile, resolution: number, extname: string, size?: number) { |
21 | expect(video).to.have.nested.property('resolution.id', resolution) | 19 | expect(video).to.have.nested.property('resolution.id', resolution) |
22 | expect(video).to.have.property('torrentUrl').that.includes(`-${resolution}.torrent`) | 20 | expect(video).to.have.property('torrentUrl').that.includes(`-${resolution}.torrent`) |
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index 48302c9e4..8897d8c23 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' | 4 | import { areObjectStorageTestsDisabled } from '@shared/core-utils' |
5 | import { HttpStatusCode, VideoFile } from '@shared/models' | 5 | import { HttpStatusCode, VideoFile } from '@shared/models' |
6 | import { | 6 | import { |
@@ -15,8 +15,6 @@ import { | |||
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared' | 16 | import { checkResolutionsInMasterPlaylist, expectStartWith } from '../shared' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | async function checkFilesInObjectStorage (files: VideoFile[], type: 'webtorrent' | 'playlist') { | 18 | async function checkFilesInObjectStorage (files: VideoFile[], type: 'webtorrent' | 'playlist') { |
21 | for (const file of files) { | 19 | for (const file of files) { |
22 | const shouldStartWith = type === 'webtorrent' | 20 | const shouldStartWith = type === 'webtorrent' |
diff --git a/server/tests/cli/print-transcode-command.ts b/server/tests/cli/print-transcode-command.ts index ab4df46fc..33b6cd27c 100644 --- a/server/tests/cli/print-transcode-command.ts +++ b/server/tests/cli/print-transcode-command.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | 4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' |
5 | import { CLICommand } from '@shared/server-commands' | 5 | import { CLICommand } from '@shared/server-commands' |
6 | import { VideoResolution } from '../../../shared/models/videos' | 6 | import { VideoResolution } from '../../../shared/models/videos' |
7 | 7 | ||
8 | const expect = chai.expect | ||
9 | |||
10 | describe('Test print transcode jobs', function () { | 8 | describe('Test print transcode jobs', function () { |
11 | 9 | ||
12 | it('Should print the correct command for each resolution', async function () { | 10 | it('Should print the correct command for each resolution', async function () { |
diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts index 15bfb30f0..a89e17e3c 100644 --- a/server/tests/cli/prune-storage.ts +++ b/server/tests/cli/prune-storage.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { createFile, readdir } from 'fs-extra' | 4 | import { createFile, readdir } from 'fs-extra' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { wait } from '@shared/core-utils' | 6 | import { wait } from '@shared/core-utils' |
@@ -19,8 +19,6 @@ import { | |||
19 | waitJobs | 19 | waitJobs |
20 | } from '@shared/server-commands' | 20 | } from '@shared/server-commands' |
21 | 21 | ||
22 | const expect = chai.expect | ||
23 | |||
24 | async function countFiles (server: PeerTubeServer, directory: string) { | 22 | async function countFiles (server: PeerTubeServer, directory: string) { |
25 | const files = await readdir(server.servers.buildDirectory(directory)) | 23 | const files = await readdir(server.servers.buildDirectory(directory)) |
26 | 24 | ||
diff --git a/server/tests/client.ts b/server/tests/client.ts index 0cb460327..39ba5fdf6 100644 --- a/server/tests/client.ts +++ b/server/tests/client.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { omit } from '@shared/core-utils' | 4 | import { omit } from '@shared/core-utils' |
5 | import { | 5 | import { |
6 | Account, | 6 | Account, |
@@ -23,8 +23,6 @@ import { | |||
23 | waitJobs | 23 | waitJobs |
24 | } from '../../shared/server-commands' | 24 | } from '../../shared/server-commands' |
25 | 25 | ||
26 | const expect = chai.expect | ||
27 | |||
28 | function checkIndexTags (html: string, title: string, description: string, css: string, config: ServerConfig) { | 26 | function checkIndexTags (html: string, title: string, description: string, css: string, config: ServerConfig) { |
29 | expect(html).to.contain('<title>' + title + '</title>') | 27 | expect(html).to.contain('<title>' + title + '</title>') |
30 | expect(html).to.contain('<meta name="description" content="' + description + '" />') | 28 | expect(html).to.contain('<meta name="description" content="' + description + '" />') |
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index 3a4b063bc..607e6a542 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { XMLParser, XMLValidator } from 'fast-xml-parser' | 4 | import { XMLParser, XMLValidator } from 'fast-xml-parser' |
5 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | 5 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
6 | import { | 6 | import { |
@@ -19,8 +19,6 @@ import { | |||
19 | chai.use(require('chai-xml')) | 19 | chai.use(require('chai-xml')) |
20 | chai.use(require('chai-json-schema')) | 20 | chai.use(require('chai-json-schema')) |
21 | chai.config.includeStack = true | 21 | chai.config.includeStack = true |
22 | const expect = chai.expect | ||
23 | |||
24 | describe('Test syndication feeds', () => { | 22 | describe('Test syndication feeds', () => { |
25 | let servers: PeerTubeServer[] = [] | 23 | let servers: PeerTubeServer[] = [] |
26 | let serverHLSOnly: PeerTubeServer | 24 | let serverHLSOnly: PeerTubeServer |
diff --git a/server/tests/helpers/comment-model.ts b/server/tests/helpers/comment-model.ts index e1c563dee..e39cae442 100644 --- a/server/tests/helpers/comment-model.ts +++ b/server/tests/helpers/comment-model.ts | |||
@@ -1,10 +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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { VideoCommentModel } from '../../models/video/video-comment' | 4 | import { VideoCommentModel } from '../../models/video/video-comment' |
5 | 5 | ||
6 | const expect = chai.expect | ||
7 | |||
8 | class CommentMock { | 6 | class CommentMock { |
9 | text: string | 7 | text: string |
10 | 8 | ||
diff --git a/server/tests/helpers/core-utils.ts b/server/tests/helpers/core-utils.ts index 4f059d982..de6ba4f82 100644 --- a/server/tests/helpers/core-utils.ts +++ b/server/tests/helpers/core-utils.ts | |||
@@ -1,14 +1,12 @@ | |||
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' | 3 | import { expect } from 'chai' |
4 | import { snakeCase } from 'lodash' | 4 | import { snakeCase } from 'lodash' |
5 | import validator from 'validator' | 5 | import validator from 'validator' |
6 | import { getAverageBitrate, getMaxBitrate } from '@shared/core-utils' | 6 | import { getAverageBitrate, getMaxBitrate } from '@shared/core-utils' |
7 | import { VideoResolution } from '@shared/models' | 7 | import { VideoResolution } from '@shared/models' |
8 | import { objectConverter, parseBytes, parseDurationToMs } from '../../helpers/core-utils' | 8 | import { objectConverter, parseBytes, parseDurationToMs } from '../../helpers/core-utils' |
9 | 9 | ||
10 | const expect = chai.expect | ||
11 | |||
12 | describe('Parse Bytes', function () { | 10 | describe('Parse Bytes', function () { |
13 | 11 | ||
14 | it('Should pass on valid value', async function () { | 12 | it('Should pass on valid value', async function () { |
diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts index 3f6a26cf9..9e404b549 100644 --- a/server/tests/misc-endpoints.ts +++ b/server/tests/misc-endpoints.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | 4 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' |
5 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | 5 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' |
6 | 6 | ||
7 | const expect = chai.expect | ||
8 | |||
9 | describe('Test misc endpoints', function () { | 7 | describe('Test misc endpoints', function () { |
10 | let server: PeerTubeServer | 8 | let server: PeerTubeServer |
11 | 9 | ||
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index e05de587d..026c7e856 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' | 4 | import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' |
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
@@ -15,8 +15,6 @@ import { | |||
15 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
16 | import { FIXTURE_URLS } from '../shared' | 16 | import { FIXTURE_URLS } from '../shared' |
17 | 17 | ||
18 | const expect = chai.expect | ||
19 | |||
20 | describe('Test plugin filter hooks', function () { | 18 | describe('Test plugin filter hooks', function () { |
21 | let servers: PeerTubeServer[] | 19 | let servers: PeerTubeServer[] |
22 | let videoUUID: string | 20 | let videoUUID: string |
diff --git a/server/tests/plugins/html-injection.ts b/server/tests/plugins/html-injection.ts index 35d710b30..fe16bf1e6 100644 --- a/server/tests/plugins/html-injection.ts +++ b/server/tests/plugins/html-injection.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | cleanupTests, | 5 | cleanupTests, |
6 | createSingleServer, | 6 | createSingleServer, |
@@ -10,8 +10,6 @@ import { | |||
10 | setAccessTokensToServers | 10 | setAccessTokensToServers |
11 | } from '@shared/server-commands' | 11 | } from '@shared/server-commands' |
12 | 12 | ||
13 | const expect = chai.expect | ||
14 | |||
15 | describe('Test plugins HTML injection', function () { | 13 | describe('Test plugins HTML injection', function () { |
16 | let server: PeerTubeServer = null | 14 | let server: PeerTubeServer = null |
17 | let command: PluginsCommand | 15 | let command: PluginsCommand |
diff --git a/server/tests/plugins/translations.ts b/server/tests/plugins/translations.ts index a76edaf44..67e4683f8 100644 --- a/server/tests/plugins/translations.ts +++ b/server/tests/plugins/translations.ts | |||
@@ -1,10 +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 * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/server-commands' | 4 | import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/server-commands' |
5 | 5 | ||
6 | const expect = chai.expect | ||
7 | |||
8 | describe('Test plugin translations', function () { | 6 | describe('Test plugin translations', function () { |
9 | let server: PeerTubeServer | 7 | let server: PeerTubeServer |
10 | let command: PluginsCommand | 8 | let command: PluginsCommand |
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts index 27e97d9c0..c388f02d1 100644 --- a/server/tests/plugins/video-constants.ts +++ b/server/tests/plugins/video-constants.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import { expect } from 'chai' |
4 | import { | 4 | import { |
5 | cleanupTests, | 5 | cleanupTests, |
6 | createSingleServer, | 6 | createSingleServer, |
@@ -11,8 +11,6 @@ import { | |||
11 | } from '@shared/server-commands' | 11 | } from '@shared/server-commands' |
12 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' | 12 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
13 | 13 | ||
14 | const expect = chai.expect | ||
15 | |||
16 | describe('Test plugin altering video constants', function () { | 14 | describe('Test plugin altering video constants', function () { |
17 | let server: PeerTubeServer | 15 | let server: PeerTubeServer |
18 | 16 | ||