From c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 10:42:24 +0200 Subject: Refactor requests --- server/tests/api/activitypub/client.ts | 4 ++-- server/tests/api/activitypub/refresher.ts | 2 +- server/tests/api/activitypub/security.ts | 19 ++++++------------- 3 files changed, 9 insertions(+), 16 deletions(-) (limited to 'server/tests/api/activitypub') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 720231f02..53cc40663 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -2,7 +2,7 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { cleanupTests, doubleFollow, @@ -68,7 +68,7 @@ describe('Test activitypub', function () { await setDefaultVideoChannel(servers) { - video = await await servers[0].videos.quickUpload({ name: 'video' }) + video = await servers[0].videos.quickUpload({ name: 'video' }) } { diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index bbec0d309..a0b72c7e6 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { cleanupTests, doubleFollow, diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index c173648b3..94d946563 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts @@ -2,20 +2,13 @@ import 'mocha' import * as chai from 'chai' +import { activityPubContextify, buildSignedActivity } from '@server/helpers/activitypub' import { buildDigest } from '@server/helpers/peertube-crypto' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' -import { - buildAbsoluteFixturePath, - cleanupTests, - createMultipleServers, - killallServers, - PeerTubeServer, - wait -} from '../../../../shared/extra-utils' -import { makeFollowRequest, makePOSTAPRequest } from '../../../../shared/extra-utils/requests/activitypub' -import { activityPubContextify, buildSignedActivity } from '../../../helpers/activitypub' -import { HTTP_SIGNATURE } from '../../../initializers/constants' -import { buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' +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/extra-utils' +import { makeFollowRequest, makePOSTAPRequest } from '@shared/extra-utils/requests/activitypub' +import { HttpStatusCode } from '@shared/models' const expect = chai.expect -- cgit v1.2.3