From c55e3d7227fe1453869e309025996b9d75256d5d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Dec 2021 11:58:15 +0100 Subject: Move test functions outside extra-utils --- server/tests/api/activitypub/cleaner.ts | 2 +- server/tests/api/activitypub/fetch.ts | 9 ++++++++- server/tests/api/activitypub/helpers.ts | 3 ++- server/tests/api/activitypub/refresher.ts | 4 ++-- server/tests/api/activitypub/security.ts | 3 ++- 5 files changed, 15 insertions(+), 6 deletions(-) (limited to 'server/tests/api/activitypub') 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 @@ import 'mocha' import * as chai from 'chai' +import { wait } from '@shared/core-utils' import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, - wait, waitJobs } from '@shared/server-commands' 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 @@ import 'mocha' import * as chai from 'chai' -import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' +import { + cleanupTests, + createMultipleServers, + doubleFollow, + PeerTubeServer, + setAccessTokensToServers, + waitJobs +} from '@shared/server-commands' const expect = chai.expect 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 @@ import 'mocha' import { expect } from 'chai' import { cloneDeep } from 'lodash' -import { buildAbsoluteFixturePath, buildRequestStub } from '@shared/server-commands' +import { buildRequestStub } from '@server/tests/shared' +import { buildAbsoluteFixturePath } from '@shared/core-utils' import { buildSignedActivity } from '../../../helpers/activitypub' import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' 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 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' +import { wait } from '@shared/core-utils' +import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' import { cleanupTests, createMultipleServers, @@ -9,10 +11,8 @@ import { PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel, - wait, waitJobs } from '@shared/server-commands' -import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' describe('Test AP refresher', function () { 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 import { buildDigest } from '@server/helpers/peertube-crypto' import { HTTP_SIGNATURE } from '@server/initializers/constants' import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' -import { buildAbsoluteFixturePath, cleanupTests, createMultipleServers, killallServers, PeerTubeServer, wait } from '@shared/server-commands' import { makeFollowRequest, makePOSTAPRequest } from '@server/tests/shared' +import { buildAbsoluteFixturePath, wait } from '@shared/core-utils' import { HttpStatusCode } from '@shared/models' +import { cleanupTests, createMultipleServers, killallServers, PeerTubeServer } from '@shared/server-commands' const expect = chai.expect -- cgit v1.2.3