MeController: Add missing mock repositories for testing

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-08-20 19:57:47 +02:00
parent 91200cb3b3
commit 35051986be
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -1,8 +1,11 @@
import { Test, TestingModule } from '@nestjs/testing';
import { getRepositoryToken } from '@nestjs/typeorm';
import { HistoryModule } from '../../../history/history.module';
import { AuthorColor } from '../../../notes/author-color.entity';
import { Note } from '../../../notes/note.entity';
import { NotesModule } from '../../../notes/notes.module';
import { AuthToken } from '../../../users/auth-token.entity';
import { Identity } from '../../../users/identity.entity';
import { User } from '../../../users/user.entity';
import { UsersModule } from '../../../users/users.module';
import { MeController } from './me.controller';
@ -19,6 +22,12 @@ describe('Me Controller', () => {
.useValue({})
.overrideProvider(getRepositoryToken(Note))
.useValue({})
.overrideProvider(getRepositoryToken(AuthToken))
.useValue({})
.overrideProvider(getRepositoryToken(Identity))
.useValue({})
.overrideProvider(getRepositoryToken(AuthorColor))
.useValue({})
.compile();
controller = module.get<MeController>(MeController);