mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 06:45:47 -04:00
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:
parent
a87408009d
commit
0ef9a338f3
4 changed files with 39 additions and 4 deletions
|
@ -21,6 +21,8 @@ import { LoggerModule } from '../logger/logger.module';
|
|||
import { AuthToken } from './auth-token.entity';
|
||||
import { NotInDBError, TokenNotValidError } from '../errors/errors';
|
||||
import { Repository } from 'typeorm';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import appConfigMock from '../config/mock/app.config.mock';
|
||||
|
||||
describe('AuthService', () => {
|
||||
let service: AuthService;
|
||||
|
@ -38,7 +40,15 @@ describe('AuthService', () => {
|
|||
useClass: Repository,
|
||||
},
|
||||
],
|
||||
imports: [PassportModule, UsersModule, LoggerModule],
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
load: [appConfigMock],
|
||||
}),
|
||||
PassportModule,
|
||||
UsersModule,
|
||||
LoggerModule,
|
||||
],
|
||||
})
|
||||
.overrideProvider(getRepositoryToken(Identity))
|
||||
.useValue({})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue