From 4c0706c9ef210e0953461572984954e861c045e8 Mon Sep 17 00:00:00 2001 From: Max Bischof Date: Wed, 25 Oct 2023 08:32:33 +0200 Subject: [PATCH] Move configuration setters above import of test module --- .../controller/api-test/task-copy-timeout.api.spec.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/server/src/modules/task/controller/api-test/task-copy-timeout.api.spec.ts b/apps/server/src/modules/task/controller/api-test/task-copy-timeout.api.spec.ts index f44a0f92fcb..1598874a56f 100644 --- a/apps/server/src/modules/task/controller/api-test/task-copy-timeout.api.spec.ts +++ b/apps/server/src/modules/task/controller/api-test/task-copy-timeout.api.spec.ts @@ -15,14 +15,14 @@ import { } from '@shared/testing'; import { Request } from 'express'; import request from 'supertest'; -// eslint-disable-next-line import/first -import { createMock } from '@golevelup/ts-jest'; -import { ServerTestModule } from '@modules/server/server.module'; -import { FilesStorageClientAdapterService } from '@src/modules/files-storage-client'; +// config must be set outside before the server module is imported, otherwise the configuration is already set Configuration.set('FEATURE_COPY_SERVICE_ENABLED', true); Configuration.set('INCOMING_REQUEST_TIMEOUT_COPY_API', 1); +// eslint-disable-next-line import/first +import { ServerTestModule } from '@modules/server/server.module'; + // This needs to be in a separate test file because of the above configuration. // When we find a way to mock the config, it should be moved alongside the other API tests. describe('Task copy (API)', () => { @@ -44,8 +44,6 @@ describe('Task copy (API)', () => { return true; }, }) - .overrideProvider(FilesStorageClientAdapterService) - .useValue(createMock()) .compile(); app = moduleFixture.createNestApplication();