mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -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
|
@ -12,6 +12,8 @@ import { Identity } from '../../../users/identity.entity';
|
|||
import { User } from '../../../users/user.entity';
|
||||
import { AuthToken } from '../../../auth/auth-token.entity';
|
||||
import { AuthModule } from '../../../auth/auth.module';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import appConfigMock from '../../../config/mock/app.config.mock';
|
||||
|
||||
describe('TokensController', () => {
|
||||
let controller: TokensController;
|
||||
|
@ -19,7 +21,14 @@ describe('TokensController', () => {
|
|||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [TokensController],
|
||||
imports: [LoggerModule, AuthModule],
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
load: [appConfigMock],
|
||||
}),
|
||||
LoggerModule,
|
||||
AuthModule,
|
||||
],
|
||||
})
|
||||
.overrideProvider(getRepositoryToken(User))
|
||||
.useValue({})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue