diff options
-rw-r--r-- | server/tests/api/check-params/contact-form.ts | 5 | ||||
-rw-r--r-- | server/tests/api/check-params/users.ts | 2 | ||||
-rw-r--r-- | server/tests/api/notifications/admin-notifications.ts | 2 | ||||
-rw-r--r-- | server/tests/api/notifications/moderation-notifications.ts | 2 | ||||
-rw-r--r-- | server/tests/api/notifications/notifications-api.ts | 2 | ||||
-rw-r--r-- | server/tests/api/notifications/user-notifications.ts | 2 | ||||
-rw-r--r-- | server/tests/api/server/contact-form.ts | 8 | ||||
-rw-r--r-- | server/tests/api/server/email.ts | 4 | ||||
-rw-r--r-- | server/tests/api/users/users-verification.ts | 8 | ||||
-rw-r--r-- | shared/extra-utils/index.ts | 11 | ||||
-rw-r--r-- | shared/extra-utils/miscs/index.ts | 3 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/index.ts | 1 | ||||
-rw-r--r-- | shared/extra-utils/mock-servers/mock-email.ts (renamed from shared/extra-utils/miscs/email.ts) | 0 | ||||
-rw-r--r-- | shared/extra-utils/users/user-notifications.ts | 2 |
14 files changed, 23 insertions, 29 deletions
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 @@ | |||
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 | 4 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | |
5 | import { cleanupTests, flushAndRunServer, immutableAssign, killallServers, reRunServer, ServerInfo } from '../../../../shared/extra-utils' | 5 | import { cleanupTests, flushAndRunServer, immutableAssign, killallServers, reRunServer, ServerInfo } from '../../../../shared/extra-utils' |
6 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' | ||
6 | import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' | 7 | import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' |
7 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | ||
8 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
9 | 8 | ||
10 | describe('Test contact form API validators', function () { | 9 | describe('Test contact form API validators', function () { |
11 | let server: ServerInfo | 10 | 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 { | |||
32 | uploadVideo, | 32 | uploadVideo, |
33 | userLogin | 33 | userLogin |
34 | } from '../../../../shared/extra-utils' | 34 | } from '../../../../shared/extra-utils' |
35 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 35 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
36 | import { | 36 | import { |
37 | checkBadCountPagination, | 37 | checkBadCountPagination, |
38 | checkBadSortPagination, | 38 | 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' | |||
6 | import { PluginType } from '@shared/models' | 6 | import { PluginType } from '@shared/models' |
7 | import { cleanupTests, installPlugin, setPluginLatestVersion, setPluginVersion, wait } from '../../../../shared/extra-utils' | 7 | import { cleanupTests, installPlugin, setPluginLatestVersion, setPluginVersion, wait } from '../../../../shared/extra-utils' |
8 | import { ServerInfo } from '../../../../shared/extra-utils/index' | 8 | import { ServerInfo } from '../../../../shared/extra-utils/index' |
9 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 9 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
10 | import { | 10 | import { |
11 | CheckerBaseParams, | 11 | CheckerBaseParams, |
12 | checkNewPeerTubeVersion, | 12 | 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 { | |||
27 | wait | 27 | wait |
28 | } from '../../../../shared/extra-utils' | 28 | } from '../../../../shared/extra-utils' |
29 | import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' | 29 | import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' |
30 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 30 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
31 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 31 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
32 | import { | 32 | import { |
33 | checkAbuseStateChange, | 33 | 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' | |||
5 | import { addUserSubscription } from '@shared/extra-utils/users/user-subscriptions' | 5 | import { addUserSubscription } from '@shared/extra-utils/users/user-subscriptions' |
6 | import { cleanupTests, getMyUserInformation, immutableAssign, uploadRandomVideo, waitJobs } from '../../../../shared/extra-utils' | 6 | import { cleanupTests, getMyUserInformation, immutableAssign, uploadRandomVideo, waitJobs } from '../../../../shared/extra-utils' |
7 | import { ServerInfo } from '../../../../shared/extra-utils/index' | 7 | import { ServerInfo } from '../../../../shared/extra-utils/index' |
8 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 8 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
9 | import { | 9 | import { |
10 | CheckerBaseParams, | 10 | CheckerBaseParams, |
11 | checkNewVideoFromSubscription, | 11 | 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 { | |||
12 | wait | 12 | wait |
13 | } from '../../../../shared/extra-utils' | 13 | } from '../../../../shared/extra-utils' |
14 | import { ServerInfo } from '../../../../shared/extra-utils/index' | 14 | import { ServerInfo } from '../../../../shared/extra-utils/index' |
15 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 15 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
16 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 16 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
17 | import { | 17 | import { |
18 | CheckerBaseParams, | 18 | 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 @@ | |||
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 * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
5 | import { cleanupTests, flushAndRunServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils' | 6 | import { cleanupTests, flushAndRunServer, ServerInfo, setAccessTokensToServers, wait } from '../../../../shared/extra-utils' |
6 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 7 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
7 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | ||
8 | import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' | 8 | import { sendContactForm } from '../../../../shared/extra-utils/server/contact-form' |
9 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 9 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
10 | 10 | ||
11 | const expect = chai.expect | 11 | const expect = chai.expect |
12 | 12 | ||
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 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
5 | import { | 6 | import { |
6 | addVideoToBlacklist, | 7 | addVideoToBlacklist, |
7 | askResetPassword, | 8 | askResetPassword, |
@@ -20,9 +21,8 @@ import { | |||
20 | userLogin, | 21 | userLogin, |
21 | verifyEmail | 22 | verifyEmail |
22 | } from '../../../../shared/extra-utils' | 23 | } from '../../../../shared/extra-utils' |
23 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 24 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
24 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 25 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
25 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
26 | 26 | ||
27 | const expect = chai.expect | 27 | const expect = chai.expect |
28 | 28 | ||
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 @@ | |||
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 * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
5 | import { | 6 | import { |
6 | cleanupTests, | 7 | cleanupTests, |
7 | flushAndRunServer, | 8 | flushAndRunServer, |
@@ -15,11 +16,10 @@ import { | |||
15 | userLogin, | 16 | userLogin, |
16 | verifyEmail | 17 | verifyEmail |
17 | } from '../../../../shared/extra-utils' | 18 | } from '../../../../shared/extra-utils' |
18 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' | 19 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' |
19 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | ||
20 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 20 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
21 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' | ||
21 | import { User } from '../../../../shared/models/users' | 22 | import { User } from '../../../../shared/models/users' |
22 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
23 | 23 | ||
24 | const expect = chai.expect | 24 | const expect = chai.expect |
25 | 25 | ||
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 @@ | |||
1 | export * from './bulk' | 1 | export * from './bulk' |
2 | |||
3 | export * from './cli' | 2 | export * from './cli' |
4 | |||
5 | export * from './custom-pages' | 3 | export * from './custom-pages' |
6 | |||
7 | export * from './feeds' | 4 | export * from './feeds' |
8 | |||
9 | export * from './logs' | 5 | export * from './logs' |
10 | 6 | export * from './miscs' | |
11 | export * from './mock-servers' | 7 | export * from './mock-servers' |
12 | 8 | ||
13 | export * from './miscs/email' | ||
14 | export * from './miscs/sql' | ||
15 | export * from './miscs/miscs' | ||
16 | export * from './miscs/stubs' | ||
17 | |||
18 | export * from './moderation/abuses' | 9 | export * from './moderation/abuses' |
19 | export * from './plugins/mock-blocklist' | 10 | export * from './plugins/mock-blocklist' |
20 | 11 | ||
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 @@ | |||
1 | export * from './miscs' | ||
2 | export * from './sql' | ||
3 | 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 @@ | |||
1 | export * from './mock-email' | ||
1 | export * from './mock-instances-index' | 2 | export * from './mock-instances-index' |
2 | export * from './mock-joinpeertube-versions' | 3 | export * from './mock-joinpeertube-versions' |
diff --git a/shared/extra-utils/miscs/email.ts b/shared/extra-utils/mock-servers/mock-email.ts index 9fc9a5ad0..9fc9a5ad0 100644 --- a/shared/extra-utils/miscs/email.ts +++ b/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' | |||
5 | import { AbuseState, PluginType } from '@shared/models' | 5 | import { AbuseState, PluginType } from '@shared/models' |
6 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | 6 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
7 | import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users' | 7 | import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users' |
8 | import { MockSmtpServer } from '../miscs/email' | 8 | import { MockSmtpServer } from '../mock-servers/mock-email' |
9 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' | 9 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' |
10 | import { doubleFollow } from '../server/follows' | 10 | import { doubleFollow } from '../server/follows' |
11 | import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' | 11 | import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' |