From 798d8d37eef1af1bef4d056c433cfe03cf82c2f4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Mar 2024 10:40:06 +0100 Subject: [PATCH] Use more specific name --- .../src/api/check-params/channel-import-videos.ts | 2 +- packages/tests/src/api/check-params/upload-quota.ts | 2 +- .../src/api/check-params/video-channel-syncs.ts | 2 +- packages/tests/src/api/check-params/video-imports.ts | 2 +- .../tests/src/api/check-params/video-passwords.ts | 2 +- packages/tests/src/api/moderation/video-blacklist.ts | 2 +- .../src/api/notifications/user-notifications.ts | 2 +- .../tests/src/api/object-storage/video-imports.ts | 2 +- packages/tests/src/api/server/config-defaults.ts | 2 +- packages/tests/src/api/server/proxy.ts | 2 +- .../tests/src/api/videos/channel-import-videos.ts | 2 +- packages/tests/src/api/videos/video-channel-syncs.ts | 2 +- packages/tests/src/api/videos/video-chapters.ts | 2 +- packages/tests/src/api/videos/video-imports.ts | 2 +- packages/tests/src/api/videos/video-source.ts | 2 +- packages/tests/src/api/videos/video-storyboard.ts | 2 +- packages/tests/src/plugins/filter-hooks.ts | 2 +- packages/tests/src/server-helpers/activitypub.ts | 5 ++++- packages/tests/src/server-helpers/request.ts | 2 +- .../tests/src/shared/{tests.ts => fixture-urls.ts} | 12 +----------- 20 files changed, 23 insertions(+), 30 deletions(-) rename packages/tests/src/shared/{tests.ts => fixture-urls.ts} (93%) diff --git a/packages/tests/src/api/check-params/channel-import-videos.ts b/packages/tests/src/api/check-params/channel-import-videos.ts index 678ad8ff5..0250c8782 100644 --- a/packages/tests/src/api/check-params/channel-import-videos.ts +++ b/packages/tests/src/api/check-params/channel-import-videos.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils' import { HttpStatusCode } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/upload-quota.ts b/packages/tests/src/api/check-params/upload-quota.ts index 89c9a25ee..9a540f6eb 100644 --- a/packages/tests/src/api/check-params/upload-quota.ts +++ b/packages/tests/src/api/check-params/upload-quota.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { randomInt } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/check-params/video-channel-syncs.ts b/packages/tests/src/api/check-params/video-channel-syncs.ts index edb0ab13f..00c3f3b66 100644 --- a/packages/tests/src/api/check-params/video-channel-syncs.ts +++ b/packages/tests/src/api/check-params/video-channel-syncs.ts @@ -1,5 +1,5 @@ import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@tests/shared/checks.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { HttpStatusCode, VideoChannelSyncCreate } from '@peertube/peertube-models' import { ChannelSyncsCommand, diff --git a/packages/tests/src/api/check-params/video-imports.ts b/packages/tests/src/api/check-params/video-imports.ts index e183301b3..1ac60fa8c 100644 --- a/packages/tests/src/api/check-params/video-imports.ts +++ b/packages/tests/src/api/check-params/video-imports.ts @@ -3,7 +3,7 @@ import { omit } from '@peertube/peertube-core-utils' import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@tests/shared/checks.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { cleanupTests, diff --git a/packages/tests/src/api/check-params/video-passwords.ts b/packages/tests/src/api/check-params/video-passwords.ts index 91db22438..69b3f50a3 100644 --- a/packages/tests/src/api/check-params/video-passwords.ts +++ b/packages/tests/src/api/check-params/video-passwords.ts @@ -16,7 +16,7 @@ import { setAccessTokensToServers } from '@peertube/peertube-server-commands' import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@tests/shared/checks.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { checkUploadVideoParam } from '@tests/shared/videos.js' describe('Test video passwords validator', function () { diff --git a/packages/tests/src/api/moderation/video-blacklist.ts b/packages/tests/src/api/moderation/video-blacklist.ts index 3a19b8204..2283fbc79 100644 --- a/packages/tests/src/api/moderation/video-blacklist.ts +++ b/packages/tests/src/api/moderation/video-blacklist.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { sortObjectComparator } from '@peertube/peertube-core-utils' import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/notifications/user-notifications.ts b/packages/tests/src/api/notifications/user-notifications.ts index b62466716..07438067a 100644 --- a/packages/tests/src/api/notifications/user-notifications.ts +++ b/packages/tests/src/api/notifications/user-notifications.ts @@ -17,7 +17,7 @@ import { checkNewLiveFromSubscription, waitUntilNotification } from '@tests/shared/notifications.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { uploadRandomVideoOnServers } from '@tests/shared/videos.js' describe('Test user notifications', function () { diff --git a/packages/tests/src/api/object-storage/video-imports.ts b/packages/tests/src/api/object-storage/video-imports.ts index 78f94bce1..ec269e7c0 100644 --- a/packages/tests/src/api/object-storage/video-imports.ts +++ b/packages/tests/src/api/object-storage/video-imports.ts @@ -2,7 +2,7 @@ import { expect } from 'chai' import { expectStartWith } from '@tests/shared/checks.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils' import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/api/server/config-defaults.ts b/packages/tests/src/api/server/config-defaults.ts index fe425976b..c50bd686b 100644 --- a/packages/tests/src/api/server/config-defaults.ts +++ b/packages/tests/src/api/server/config-defaults.ts @@ -9,7 +9,7 @@ import { setAccessTokensToServers, setDefaultVideoChannel } from '@peertube/peertube-server-commands' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' describe('Test config defaults', function () { let server: PeerTubeServer diff --git a/packages/tests/src/api/server/proxy.ts b/packages/tests/src/api/server/proxy.ts index b95825187..8e1b50e76 100644 --- a/packages/tests/src/api/server/proxy.ts +++ b/packages/tests/src/api/server/proxy.ts @@ -13,7 +13,7 @@ import { setDefaultVideoChannel, waitJobs } from '@peertube/peertube-server-commands' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { expectStartWith, expectNotStartWith } from '@tests/shared/checks.js' import { MockProxy } from '@tests/shared/mock-servers/mock-proxy.js' diff --git a/packages/tests/src/api/videos/channel-import-videos.ts b/packages/tests/src/api/videos/channel-import-videos.ts index b37b68065..8827f0782 100644 --- a/packages/tests/src/api/videos/channel-import-videos.ts +++ b/packages/tests/src/api/videos/channel-import-videos.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { expect } from 'chai' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils' import { createSingleServer, diff --git a/packages/tests/src/api/videos/video-channel-syncs.ts b/packages/tests/src/api/videos/video-channel-syncs.ts index 28f2f80ba..098d33c02 100644 --- a/packages/tests/src/api/videos/video-channel-syncs.ts +++ b/packages/tests/src/api/videos/video-channel-syncs.ts @@ -15,7 +15,7 @@ import { waitJobs } from '@peertube/peertube-server-commands' import { SQLCommand } from '@tests/shared/sql-command.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' describe('Test channel synchronizations', function () { if (areHttpImportTestsDisabled()) return diff --git a/packages/tests/src/api/videos/video-chapters.ts b/packages/tests/src/api/videos/video-chapters.ts index 7e7d653f9..5be0e33d6 100644 --- a/packages/tests/src/api/videos/video-chapters.ts +++ b/packages/tests/src/api/videos/video-chapters.ts @@ -9,7 +9,7 @@ import { setDefaultVideoChannel, waitJobs } from '@peertube/peertube-server-commands' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { expect } from 'chai' describe('Test video chapters', function () { diff --git a/packages/tests/src/api/videos/video-imports.ts b/packages/tests/src/api/videos/video-imports.ts index 6cfae80b4..90d9e2174 100644 --- a/packages/tests/src/api/videos/video-imports.ts +++ b/packages/tests/src/api/videos/video-imports.ts @@ -20,7 +20,7 @@ import { import { DeepPartial } from '@peertube/peertube-typescript-utils' import { testCaptionFile } from '@tests/shared/captions.js' import { testImageGeneratedByFFmpeg } from '@tests/shared/checks.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMagnet: string, idTorrent: string) { const videoHttp = await server.videos.get({ id: idHttp }) diff --git a/packages/tests/src/api/videos/video-source.ts b/packages/tests/src/api/videos/video-source.ts index 73d620aa1..6ecb04ea2 100644 --- a/packages/tests/src/api/videos/video-source.ts +++ b/packages/tests/src/api/videos/video-source.ts @@ -16,7 +16,7 @@ import { } from '@peertube/peertube-server-commands' import { expectStartWith } from '@tests/shared/checks.js' import { checkDirectoryIsEmpty } from '@tests/shared/directories.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { checkSourceFile } from '@tests/shared/videos.js' import { expect } from 'chai' diff --git a/packages/tests/src/api/videos/video-storyboard.ts b/packages/tests/src/api/videos/video-storyboard.ts index b5d5d0d8f..efcb2295b 100644 --- a/packages/tests/src/api/videos/video-storyboard.ts +++ b/packages/tests/src/api/videos/video-storyboard.ts @@ -3,7 +3,7 @@ import { expect } from 'chai' import { readdir } from 'fs/promises' import { basename } from 'path' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' import { areHttpImportTestsDisabled } from '@peertube/peertube-node-utils' import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models' import { diff --git a/packages/tests/src/plugins/filter-hooks.ts b/packages/tests/src/plugins/filter-hooks.ts index 26ba149be..5ae85e7be 100644 --- a/packages/tests/src/plugins/filter-hooks.ts +++ b/packages/tests/src/plugins/filter-hooks.ts @@ -23,7 +23,7 @@ import { setDefaultVideoChannel, waitJobs } from '@peertube/peertube-server-commands' -import { FIXTURE_URLS } from '../shared/tests.js' +import { FIXTURE_URLS } from '../shared/fixture-urls.js' import { expectEndWith } from '@tests/shared/checks.js' describe('Test plugin filter hooks', function () { diff --git a/packages/tests/src/server-helpers/activitypub.ts b/packages/tests/src/server-helpers/activitypub.ts index 43ecdda56..8b8b7a45b 100644 --- a/packages/tests/src/server-helpers/activitypub.ts +++ b/packages/tests/src/server-helpers/activitypub.ts @@ -4,11 +4,14 @@ import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils' import { signAndContextify } from '@peertube/peertube-server/core/helpers/activity-pub-utils.js' import { isHTTPSignatureVerified, parseHTTPSignature } from '@peertube/peertube-server/core/helpers/peertube-crypto.js' import { isJsonLDSignatureVerified, signJsonLDObject } from '@peertube/peertube-server/core/helpers/peertube-jsonld.js' -import { buildRequestStub } from '@tests/shared/tests.js' import { expect } from 'chai' import { readJsonSync } from 'fs-extra/esm' import cloneDeep from 'lodash-es/cloneDeep.js' +function buildRequestStub (): any { + return { } +} + function signJsonLDObjectWithoutAssertion (options: Parameters[0]) { return signJsonLDObject({ ...options, diff --git a/packages/tests/src/server-helpers/request.ts b/packages/tests/src/server-helpers/request.ts index 6045d2559..38a74f6ea 100644 --- a/packages/tests/src/server-helpers/request.ts +++ b/packages/tests/src/server-helpers/request.ts @@ -7,7 +7,7 @@ import { wait } from '@peertube/peertube-core-utils' import { root } from '@peertube/peertube-node-utils' import { doRequest, doRequestAndSaveToFile } from '@peertube/peertube-server/core/helpers/requests.js' import { Mock429 } from '@tests/shared/mock-servers/mock-429.js' -import { FIXTURE_URLS } from '@tests/shared/tests.js' +import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js' describe('Request helpers', function () { const destPath1 = join(root(), 'test-output-1.txt') diff --git a/packages/tests/src/shared/tests.ts b/packages/tests/src/shared/fixture-urls.ts similarity index 93% rename from packages/tests/src/shared/tests.ts rename to packages/tests/src/shared/fixture-urls.ts index 554ed0e1f..56638e13b 100644 --- a/packages/tests/src/shared/tests.ts +++ b/packages/tests/src/shared/fixture-urls.ts @@ -1,4 +1,4 @@ -const FIXTURE_URLS = { +export const FIXTURE_URLS = { peertube_long: 'https://peertube2.cpy.re/videos/watch/122d093a-1ede-43bd-bd34-59d2931ffc5e', peertube_short: 'https://peertube2.cpy.re/w/3fbif9S3WmtTP8gGsC5HBd', @@ -31,13 +31,3 @@ const FIXTURE_URLS = { file4K: 'https://download.cpy.re/peertube/4k_file.txt' } - -function buildRequestStub (): any { - return { } -} - -export { - FIXTURE_URLS, - - buildRequestStub -}