mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-04 08:49:59 -04:00
Add config to tests in various places
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
9f170bca4c
commit
ce65f2c51a
4 changed files with 44 additions and 3 deletions
|
@ -4,8 +4,10 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { getRepositoryToken } from '@nestjs/typeorm';
|
||||
import appConfigMock from '../config/app.config.mock';
|
||||
import { LoggerModule } from '../logger/logger.module';
|
||||
import { AuthorColor } from '../notes/author-color.entity';
|
||||
import { Note } from '../notes/note.entity';
|
||||
|
@ -17,6 +19,7 @@ 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 { FilesystemBackend } from './backends/filesystem-backend';
|
||||
import { MediaUpload } from './media-upload.entity';
|
||||
import { MediaService } from './media.service';
|
||||
|
||||
|
@ -31,8 +34,17 @@ describe('MediaService', () => {
|
|||
provide: getRepositoryToken(MediaUpload),
|
||||
useValue: {},
|
||||
},
|
||||
FilesystemBackend,
|
||||
],
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
load: [appConfigMock],
|
||||
}),
|
||||
LoggerModule,
|
||||
NotesModule,
|
||||
UsersModule,
|
||||
],
|
||||
imports: [LoggerModule, NotesModule, UsersModule],
|
||||
})
|
||||
.overrideProvider(getRepositoryToken(AuthorColor))
|
||||
.useValue({})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue