UnitTests: Add appConfigMock

This is necessary as the Logger needs this config for the loglevel.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-04-14 00:19:09 +02:00 committed by David Mehren
parent edc62285a2
commit 846bbeb390
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 39 additions and 4 deletions

View file

@ -11,6 +11,8 @@ import { Repository } from 'typeorm';
import { Group } from './group.entity';
import { NotInDBError } from '../errors/errors';
import { LoggerModule } from '../logger/logger.module';
import { ConfigModule } from '@nestjs/config';
import appConfigMock from '../config/mock/app.config.mock';
describe('GroupsService', () => {
let service: GroupsService;
@ -26,7 +28,13 @@ describe('GroupsService', () => {
useClass: Repository,
},
],
imports: [LoggerModule],
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [appConfigMock],
}),
LoggerModule,
],
}).compile();
service = module.get<GroupsService>(GroupsService);