aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorlutangar <johan.dufour@gmail.com>2021-11-02 19:11:20 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-12-16 10:08:43 +0100
commit06aad80165d09a8863ab8103149a8ff518b10641 (patch)
treea97fa31f3ade29ff807ca1b77704eb47085ab99d /server/tests/api
parent854f533c12bd2b88c70f9d5aeab770059e9a6861 (diff)
downloadPeerTube-06aad80165d09a8863ab8103149a8ff518b10641.tar.gz
PeerTube-06aad80165d09a8863ab8103149a8ff518b10641.tar.zst
PeerTube-06aad80165d09a8863ab8103149a8ff518b10641.zip
chore(refactor): remove shared folder dependencies to the server
Many files from the `shared` folder were importing files from the `server` folder. When attempting to use Typescript project references to describe dependencies, it highlighted a circular dependency beetween `shared` <-> `server`. The Typescript project forbid such usages. Using project references greatly improve performance by rebuilding only the updated project and not all source files. > see https://www.typescriptlang.org/docs/handbook/project-references.html
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/activitypub/security.ts2
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts2
-rw-r--r--server/tests/api/notifications/user-notifications.ts2
-rw-r--r--server/tests/api/server/follows.ts2
-rw-r--r--server/tests/api/server/handle-down.ts2
-rw-r--r--server/tests/api/videos/multiple-servers.ts2
-rw-r--r--server/tests/api/videos/single-server.ts2
7 files changed, 7 insertions, 7 deletions
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts
index 94d946563..2700cff13 100644
--- a/server/tests/api/activitypub/security.ts
+++ b/server/tests/api/activitypub/security.ts
@@ -7,7 +7,7 @@ import { buildDigest } from '@server/helpers/peertube-crypto'
7import { HTTP_SIGNATURE } from '@server/initializers/constants' 7import { HTTP_SIGNATURE } from '@server/initializers/constants'
8import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' 8import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils'
9import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/extra-utils' 9import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/extra-utils'
10import { makeFollowRequest, makePOSTAPRequest } from '@shared/extra-utils/requests/activitypub' 10import { makeFollowRequest, makePOSTAPRequest } from '@server/tests/shared'
11import { HttpStatusCode } from '@shared/models' 11import { HttpStatusCode } from '@shared/models'
12 12
13const expect = chai.expect 13const expect = chai.expect
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 81ce8061b..6d8e5359b 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -1,7 +1,7 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import { buildUUID } from '@server/helpers/uuid' 4import { buildUUID } from '@shared/core-utils/uuid'
5import { 5import {
6 checkAbuseStateChange, 6 checkAbuseStateChange,
7 checkAutoInstanceFollowing, 7 checkAutoInstanceFollowing,
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts
index 9af20843e..6db0347cc 100644
--- a/server/tests/api/notifications/user-notifications.ts
+++ b/server/tests/api/notifications/user-notifications.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { buildUUID } from '@server/helpers/uuid' 5import { buildUUID } from '@shared/core-utils/uuid'
6import { 6import {
7 CheckerBaseParams, 7 CheckerBaseParams,
8 checkMyVideoImportIsFinished, 8 checkMyVideoImportIsFinished,
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts
index 832ba561a..748f4cd35 100644
--- a/server/tests/api/server/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 completeVideoCheck,
8 createMultipleServers, 7 createMultipleServers,
9 dateIsValid, 8 dateIsValid,
10 expectAccountFollows, 9 expectAccountFollows,
@@ -15,6 +14,7 @@ import {
15 waitJobs 14 waitJobs
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
17import { VideoCreateResult, VideoPrivacy } from '@shared/models' 16import { VideoCreateResult, VideoPrivacy } from '@shared/models'
17import { completeVideoCheck } from '@server/tests/shared/video'
18 18
19const expect = chai.expect 19const expect = chai.expect
20 20
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts
index fa1da8fe0..2d059c0ed 100644
--- a/server/tests/api/server/handle-down.ts
+++ b/server/tests/api/server/handle-down.ts
@@ -5,7 +5,6 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 CommentsCommand, 7 CommentsCommand,
8 completeVideoCheck,
9 createMultipleServers, 8 createMultipleServers,
10 killallServers, 9 killallServers,
11 PeerTubeServer, 10 PeerTubeServer,
@@ -14,6 +13,7 @@ import {
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models' 15import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'
16import { completeVideoCheck } from '@server/tests/shared/video'
17 17
18const expect = chai.expect 18const expect = chai.expect
19 19
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index c6c279064..9e7b39cfa 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -8,7 +8,6 @@ import {
8 checkTmpIsEmpty, 8 checkTmpIsEmpty,
9 checkVideoFilesWereRemoved, 9 checkVideoFilesWereRemoved,
10 cleanupTests, 10 cleanupTests,
11 completeVideoCheck,
12 createMultipleServers, 11 createMultipleServers,
13 dateIsValid, 12 dateIsValid,
14 doubleFollow, 13 doubleFollow,
@@ -21,6 +20,7 @@ import {
21 webtorrentAdd 20 webtorrentAdd
22} from '@shared/extra-utils' 21} from '@shared/extra-utils'
23import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models' 22import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
23import { completeVideoCheck } from '@server/tests/shared/video'
24 24
25const expect = chai.expect 25const expect = chai.expect
26 26
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts
index a0e4a156c..100067f18 100644
--- a/server/tests/api/videos/single-server.ts
+++ b/server/tests/api/videos/single-server.ts
@@ -5,7 +5,6 @@ import * as chai from 'chai'
5import { 5import {
6 checkVideoFilesWereRemoved, 6 checkVideoFilesWereRemoved,
7 cleanupTests, 7 cleanupTests,
8 completeVideoCheck,
9 createSingleServer, 8 createSingleServer,
10 PeerTubeServer, 9 PeerTubeServer,
11 setAccessTokensToServers, 10 setAccessTokensToServers,
@@ -13,6 +12,7 @@ import {
13 wait 12 wait
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { Video, VideoPrivacy } from '@shared/models' 14import { Video, VideoPrivacy } from '@shared/models'
15import { completeVideoCheck } from '@server/tests/shared/video'
16 16
17const expect = chai.expect 17const expect = chai.expect
18 18