diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-17 11:58:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-17 12:24:03 +0100 |
commit | c55e3d7227fe1453869e309025996b9d75256d5d (patch) | |
tree | 08e9b0ca210d75c82c8606fef0852eca020e8e0e /server/tests/api/activitypub | |
parent | bf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff) | |
download | PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.gz PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.zst PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.zip |
Move test functions outside extra-utils
Diffstat (limited to 'server/tests/api/activitypub')
-rw-r--r-- | server/tests/api/activitypub/cleaner.ts | 2 | ||||
-rw-r--r-- | server/tests/api/activitypub/fetch.ts | 9 | ||||
-rw-r--r-- | server/tests/api/activitypub/helpers.ts | 3 | ||||
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 4 | ||||
-rw-r--r-- | server/tests/api/activitypub/security.ts | 3 |
5 files changed, 15 insertions, 6 deletions
diff --git a/server/tests/api/activitypub/cleaner.ts b/server/tests/api/activitypub/cleaner.ts index c3368c7eb..7a443b553 100644 --- a/server/tests/api/activitypub/cleaner.ts +++ b/server/tests/api/activitypub/cleaner.ts | |||
@@ -2,13 +2,13 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { wait } from '@shared/core-utils' | ||
5 | import { | 6 | import { |
6 | cleanupTests, | 7 | cleanupTests, |
7 | createMultipleServers, | 8 | createMultipleServers, |
8 | doubleFollow, | 9 | doubleFollow, |
9 | PeerTubeServer, | 10 | PeerTubeServer, |
10 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
11 | wait, | ||
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/server-commands' | 13 | } from '@shared/server-commands' |
14 | 14 | ||
diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index 93bf01842..cc71e82ea 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts | |||
@@ -2,7 +2,14 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | 5 | import { |
6 | cleanupTests, | ||
7 | createMultipleServers, | ||
8 | doubleFollow, | ||
9 | PeerTubeServer, | ||
10 | setAccessTokensToServers, | ||
11 | waitJobs | ||
12 | } from '@shared/server-commands' | ||
6 | 13 | ||
7 | const expect = chai.expect | 14 | const expect = chai.expect |
8 | 15 | ||
diff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.ts index 5aa94af5d..25e1d9823 100644 --- a/server/tests/api/activitypub/helpers.ts +++ b/server/tests/api/activitypub/helpers.ts | |||
@@ -3,7 +3,8 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { cloneDeep } from 'lodash' | 5 | import { cloneDeep } from 'lodash' |
6 | import { buildAbsoluteFixturePath, buildRequestStub } from '@shared/server-commands' | 6 | import { buildRequestStub } from '@server/tests/shared' |
7 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | ||
7 | import { buildSignedActivity } from '../../../helpers/activitypub' | 8 | import { buildSignedActivity } from '../../../helpers/activitypub' |
8 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' | 9 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' |
9 | 10 | ||
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index 669a86fca..71e1c40ba 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -1,6 +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 'mocha' | 3 | import 'mocha' |
4 | import { wait } from '@shared/core-utils' | ||
5 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' | ||
4 | import { | 6 | import { |
5 | cleanupTests, | 7 | cleanupTests, |
6 | createMultipleServers, | 8 | createMultipleServers, |
@@ -9,10 +11,8 @@ import { | |||
9 | PeerTubeServer, | 11 | PeerTubeServer, |
10 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
11 | setDefaultVideoChannel, | 13 | setDefaultVideoChannel, |
12 | wait, | ||
13 | waitJobs | 14 | waitJobs |
14 | } from '@shared/server-commands' | 15 | } from '@shared/server-commands' |
15 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' | ||
16 | 16 | ||
17 | describe('Test AP refresher', function () { | 17 | describe('Test AP refresher', function () { |
18 | let servers: PeerTubeServer[] = [] | 18 | let servers: PeerTubeServer[] = [] |
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index 3b871ae12..c4cb5ea0d 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts | |||
@@ -6,9 +6,10 @@ import { activityPubContextify, buildSignedActivity } from '@server/helpers/acti | |||
6 | import { buildDigest } from '@server/helpers/peertube-crypto' | 6 | import { buildDigest } from '@server/helpers/peertube-crypto' |
7 | import { HTTP_SIGNATURE } from '@server/initializers/constants' | 7 | import { HTTP_SIGNATURE } from '@server/initializers/constants' |
8 | import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' | 8 | import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' |
9 | import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/server-commands' | ||
10 | import { makeFollowRequest, makePOSTAPRequest } from '@server/tests/shared' | 9 | import { makeFollowRequest, makePOSTAPRequest } from '@server/tests/shared' |
10 | import { buildAbsoluteFixturePath, wait } from '@shared/core-utils' | ||
11 | import { HttpStatusCode } from '@shared/models' | 11 | import { HttpStatusCode } from '@shared/models' |
12 | import { cleanupTests, createMultipleServers, killallServers, PeerTubeServer } from '@shared/server-commands' | ||
12 | 13 | ||
13 | const expect = chai.expect | 14 | const expect = chai.expect |
14 | 15 | ||