Add missing TagRepository provider in unit tests

Signed-off-by: David Mehren <git@herrmehren.de>
Co-authored-by: Yannick Bungers <git@innay.de>
This commit is contained in:
David Mehren 2020-10-03 17:24:42 +02:00
parent 9152f05c61
commit a04d5b29f9
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 20 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import { LoggerModule } from '../../../logger/logger.module';
import { AuthorColor } from '../../../notes/author-color.entity';
import { Note } from '../../../notes/note.entity';
import { NotesModule } from '../../../notes/notes.module';
import { Tag } from '../../../notes/tag.entity';
import { Authorship } from '../../../revisions/authorship.entity';
import { Revision } from '../../../revisions/revision.entity';
import { AuthToken } from '../../../users/auth-token.entity';
@ -35,6 +36,8 @@ describe('Me Controller', () => {
.useValue({})
.overrideProvider(getRepositoryToken(Revision))
.useValue({})
.overrideProvider(getRepositoryToken(Tag))
.useValue({})
.compile();
controller = module.get<MeController>(MeController);

View file

@ -4,6 +4,7 @@ import { LoggerModule } from '../../../logger/logger.module';
import { AuthorColor } from '../../../notes/author-color.entity';
import { Note } from '../../../notes/note.entity';
import { NotesService } from '../../../notes/notes.service';
import { Tag } from '../../../notes/tag.entity';
import { Authorship } from '../../../revisions/authorship.entity';
import { Revision } from '../../../revisions/revision.entity';
import { RevisionsModule } from '../../../revisions/revisions.module';
@ -25,6 +26,10 @@ describe('Notes Controller', () => {
provide: getRepositoryToken(Note),
useValue: {},
},
{
provide: getRepositoryToken(Tag),
useValue: {},
},
],
imports: [RevisionsModule, UsersModule, LoggerModule],
})
@ -44,6 +49,8 @@ describe('Notes Controller', () => {
.useValue({})
.overrideProvider(getRepositoryToken(Note))
.useValue({})
.overrideProvider(getRepositoryToken(Tag))
.useValue({})
.compile();
controller = module.get<NotesController>(NotesController);

View file

@ -11,6 +11,7 @@ import { UsersModule } from '../users/users.module';
import { AuthorColor } from './author-color.entity';
import { Note } from './note.entity';
import { NotesService } from './notes.service';
import { Tag } from './tag.entity';
describe('NotesService', () => {
let service: NotesService;
@ -23,6 +24,10 @@ describe('NotesService', () => {
provide: getRepositoryToken(Note),
useValue: {},
},
{
provide: getRepositoryToken(Tag),
useValue: {},
},
],
imports: [UsersModule, RevisionsModule, LoggerModule],
})
@ -40,6 +45,8 @@ describe('NotesService', () => {
.useValue({})
.overrideProvider(getRepositoryToken(Note))
.useValue({})
.overrideProvider(getRepositoryToken(Tag))
.useValue({})
.compile();
service = module.get<NotesService>(NotesService);
});

View file

@ -10,6 +10,7 @@ import { User } from '../users/user.entity';
import { Authorship } from './authorship.entity';
import { Revision } from './revision.entity';
import { RevisionsService } from './revisions.service';
import { Tag } from '../notes/tag.entity';
describe('RevisionsService', () => {
let service: RevisionsService;
@ -39,6 +40,8 @@ describe('RevisionsService', () => {
.useValue({})
.overrideProvider(getRepositoryToken(Revision))
.useValue({})
.overrideProvider(getRepositoryToken(Tag))
.useValue({})
.compile();
service = module.get<RevisionsService>(RevisionsService);