diff --git a/src/config/mock/auth.config.mock.ts b/src/config/mock/auth.config.mock.ts index 9ffada095..cbac194e2 100644 --- a/src/config/mock/auth.config.mock.ts +++ b/src/config/mock/auth.config.mock.ts @@ -1,43 +1,48 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ import { registerAs } from '@nestjs/config'; -export default registerAs('authConfig', () => ({ - session: { - secret: 'my_secret', - lifetime: 1209600000, - }, - local: { - enableLogin: true, - enableRegister: true, - }, - facebook: { - clientID: undefined, - clientSecret: undefined, - }, - twitter: { - consumerKey: undefined, - consumerSecret: undefined, - }, - github: { - clientID: undefined, - clientSecret: undefined, - }, - dropbox: { - clientID: undefined, - clientSecret: undefined, - appKey: undefined, - }, - google: { - clientID: undefined, - clientSecret: undefined, - apiKey: undefined, - }, - gitlab: [], - ldap: [], - saml: [], - oauth2: [], -})); +import { AuthConfig } from '../auth.config'; + +export default registerAs( + 'authConfig', + (): AuthConfig => ({ + session: { + secret: 'my_secret', + lifetime: 1209600000, + }, + local: { + enableLogin: true, + enableRegister: true, + }, + facebook: { + clientID: '', + clientSecret: '', + }, + twitter: { + consumerKey: '', + consumerSecret: '', + }, + github: { + clientID: '', + clientSecret: '', + }, + dropbox: { + clientID: '', + clientSecret: '', + appKey: '', + }, + google: { + clientID: '', + clientSecret: '', + apiKey: '', + }, + gitlab: [], + ldap: [], + saml: [], + oauth2: [], + }), +); diff --git a/src/config/mock/customization.config.mock.ts b/src/config/mock/customization.config.mock.ts index b9e7281e6..80d4b9a16 100644 --- a/src/config/mock/customization.config.mock.ts +++ b/src/config/mock/customization.config.mock.ts @@ -1,18 +1,23 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ import { registerAs } from '@nestjs/config'; -export default registerAs('customizationConfig', () => ({ - branding: { - customName: 'ACME Corp', - customLogo: '', - }, - specialUrls: { - privacy: '/test/privacy', - termsOfUse: '/test/termsOfUse', - imprint: '/test/imprint', - }, -})); +import { CustomizationConfig } from '../customization.config'; + +export default registerAs( + 'customizationConfig', + (): CustomizationConfig => ({ + branding: { + customName: 'ACME Corp', + customLogo: '', + }, + specialUrls: { + privacy: '/test/privacy', + termsOfUse: '/test/termsOfUse', + imprint: '/test/imprint', + }, + }), +); diff --git a/src/config/mock/external-services.config.mock.ts b/src/config/mock/external-services.config.mock.ts index 736f37552..231b4a832 100644 --- a/src/config/mock/external-services.config.mock.ts +++ b/src/config/mock/external-services.config.mock.ts @@ -1,11 +1,16 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ import { registerAs } from '@nestjs/config'; -export default registerAs('externalServicesConfig', () => ({ - plantUmlServer: 'plantuml.example.com', - imageProxy: 'imageProxy.example.com', -})); +import { ExternalServicesConfig } from '../external-services.config'; + +export default registerAs( + 'externalServicesConfig', + (): ExternalServicesConfig => ({ + plantUmlServer: 'plantuml.example.com', + imageProxy: 'imageProxy.example.com', + }), +); diff --git a/src/config/mock/media.config.mock.ts b/src/config/mock/media.config.mock.ts index b3e73eaf7..51320a272 100644 --- a/src/config/mock/media.config.mock.ts +++ b/src/config/mock/media.config.mock.ts @@ -1,16 +1,24 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ import { registerAs } from '@nestjs/config'; -export default registerAs('mediaConfig', () => ({ - backend: { - use: 'filesystem', - filesystem: { - uploadPath: - 'test_uploads' + Math.floor(Math.random() * 100000).toString(), +import { BackendType } from '../../media/backends/backend-type.enum'; +import { MediaBackendConfig, MediaConfig } from '../media.config'; + +export default registerAs( + 'mediaConfig', + (): Omit & { + backend: Pick; + } => ({ + backend: { + use: BackendType.FILESYSTEM, + filesystem: { + uploadPath: + 'test_uploads' + Math.floor(Math.random() * 100000).toString(), + }, }, - }, -})); + }), +);