diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts index c7f9c1b47..274562cbb 100644 --- a/server/tests/api/check-params/contact-form.ts +++ b/server/tests/api/check-params/contact-form.ts @@ -1,11 +1,10 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' - -import { cleanupTests, flushAndRunServer, immutableAssign, killallServers, reRunServer, ServerInfo } from '../../../../shared/extra-utils' -import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { cleanupTests, flushAndRunServer, immutableAssign, killallServers, reRunServer, ServerInfo } from '../../../../shared/extra-utils' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' +import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' describe('Test contact form API validators', function () { let server: ServerInfo diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 70a872ce5..da0f55bf8 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -32,7 +32,7 @@ import { uploadVideo, userLogin } from '../../../../shared/extra-utils' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { checkBadCountPagination, checkBadSortPagination, diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts index 170aa4532..91681c9d6 100644 --- a/server/tests/api/notifications/admin-notifications.ts +++ b/server/tests/api/notifications/admin-notifications.ts @@ -6,7 +6,7 @@ import { MockJoinPeerTubeVersions } from '@shared/extra-utils' import { PluginType } from '@shared/models' import { cleanupTests, installPlugin, setPluginLatestVersion, setPluginVersion, wait } from '../../../../shared/extra-utils' import { ServerInfo } from '../../../../shared/extra-utils/index' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { CheckerBaseParams, checkNewPeerTubeVersion, diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts index 3425480ae..a7671696f 100644 --- a/server/tests/api/notifications/moderation-notifications.ts +++ b/server/tests/api/notifications/moderation-notifications.ts @@ -27,7 +27,7 @@ import { wait } from '../../../../shared/extra-utils' import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { checkAbuseStateChange, diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts index b81995449..19f9dbbab 100644 --- a/server/tests/api/notifications/notifications-api.ts +++ b/server/tests/api/notifications/notifications-api.ts @@ -5,7 +5,7 @@ import * as chai from 'chai' import { addUserSubscription } from '@shared/extra-utils/users/user-subscriptions' import { cleanupTests, getMyUserInformation, immutableAssign, uploadRandomVideo, waitJobs } from '../../../../shared/extra-utils' import { ServerInfo } from '../../../../shared/extra-utils/index' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { CheckerBaseParams, checkNewVideoFromSubscription, diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts index e981c1718..ace7e48c7 100644 --- a/server/tests/api/notifications/user-notifications.ts +++ b/server/tests/api/notifications/user-notifications.ts @@ -12,7 +12,7 @@ import { wait } from '../../../../shared/extra-utils' import { ServerInfo } from '../../../../shared/extra-utils/index' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { waitJobs } from '../../../../shared/extra-utils/server/jobs' import { CheckerBaseParams, diff --git a/server/tests/api/server/contact-form.ts b/server/tests/api/server/contact-form.ts index 8851ad55e..71205723d 100644 --- a/server/tests/api/server/contact-form.ts +++ b/server/tests/api/server/contact-form.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' import 'mocha' -import { cleanupTests, flushAndRunServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' -import { waitJobs } from '../../../../shared/extra-utils/server/jobs' -import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' +import * as chai from 'chai' import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { cleanupTests, flushAndRunServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' +import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' +import { waitJobs } from '../../../../shared/extra-utils/server/jobs' const expect = chai.expect diff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.ts index 92768d9df..41071692a 100644 --- a/server/tests/api/server/email.ts +++ b/server/tests/api/server/email.ts @@ -2,6 +2,7 @@ import 'mocha' import * as chai from 'chai' +import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' import { addVideoToBlacklist, askResetPassword, @@ -20,9 +21,8 @@ import { userLogin, verifyEmail } from '../../../../shared/extra-utils' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { waitJobs } from '../../../../shared/extra-utils/server/jobs' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const expect = chai.expect diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts index e0f2f2112..265cd6050 100644 --- a/server/tests/api/users/users-verification.ts +++ b/server/tests/api/users/users-verification.ts @@ -1,7 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import * as chai from 'chai' import 'mocha' +import * as chai from 'chai' +import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' import { cleanupTests, flushAndRunServer, @@ -15,11 +16,10 @@ import { userLogin, verifyEmail } from '../../../../shared/extra-utils' -import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' -import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' +import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' import { waitJobs } from '../../../../shared/extra-utils/server/jobs' +import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' import { User } from '../../../../shared/models/users' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const expect = chai.expect diff --git a/shared/extra-utils/index.ts b/shared/extra-utils/index.ts index 30f44dfc2..7d2887209 100644 --- a/shared/extra-utils/index.ts +++ b/shared/extra-utils/index.ts @@ -1,20 +1,11 @@ export * from './bulk' - export * from './cli' - export * from './custom-pages' - export * from './feeds' - export * from './logs' - +export * from './miscs' export * from './mock-servers' -export * from './miscs/email' -export * from './miscs/sql' -export * from './miscs/miscs' -export * from './miscs/stubs' - export * from './moderation/abuses' export * from './plugins/mock-blocklist' diff --git a/shared/extra-utils/miscs/index.ts b/shared/extra-utils/miscs/index.ts new file mode 100644 index 000000000..ccacd4c79 --- /dev/null +++ b/shared/extra-utils/miscs/index.ts @@ -0,0 +1,3 @@ +export * from './miscs' +export * from './sql' +export * from './stubs' diff --git a/shared/extra-utils/mock-servers/index.ts b/shared/extra-utils/mock-servers/index.ts index 47679c818..485757843 100644 --- a/shared/extra-utils/mock-servers/index.ts +++ b/shared/extra-utils/mock-servers/index.ts @@ -1,2 +1,3 @@ +export * from './mock-email' export * from './mock-instances-index' export * from './mock-joinpeertube-versions' diff --git a/shared/extra-utils/miscs/email.ts b/shared/extra-utils/mock-servers/mock-email.ts similarity index 100% rename from shared/extra-utils/miscs/email.ts rename to shared/extra-utils/mock-servers/mock-email.ts diff --git a/shared/extra-utils/users/user-notifications.ts b/shared/extra-utils/users/user-notifications.ts index 844f4442d..e75946eec 100644 --- a/shared/extra-utils/users/user-notifications.ts +++ b/shared/extra-utils/users/user-notifications.ts @@ -5,7 +5,7 @@ import { inspect } from 'util' import { AbuseState, PluginType } from '@shared/models' import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users' -import { MockSmtpServer } from '../miscs/email' +import { MockSmtpServer } from '../mock-servers/mock-email' import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' import { doubleFollow } from '../server/follows' import { flushAndRunMultipleServers, ServerInfo } from '../server/servers'