Skip to content

Commit

Permalink
Move configuration setters above import of test module
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax committed Oct 25, 2023
1 parent 9a52633 commit 4c0706c
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)', () => {
Expand All @@ -44,8 +44,6 @@ describe('Task copy (API)', () => {
return true;
},
})
.overrideProvider(FilesStorageClientAdapterService)
.useValue(createMock<FilesStorageClientAdapterService>())
.compile();

app = moduleFixture.createNestApplication();
Expand Down

0 comments on commit 4c0706c

Please sign in to comment.