[E2E tests] Don't use hardcoded service tokens

The DI tokens for services seem to have changed with NestJS 8.
As we can also use the class object instead of a hardcoded token,
this commit replaces the tokens accordingly.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-07-15 20:30:51 +02:00
parent 28a1628722
commit a8d6b33139
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 4 additions and 4 deletions

View file

@ -71,9 +71,9 @@ describe('Media', () => {
const logger = await app.resolve(ConsoleLoggerService); const logger = await app.resolve(ConsoleLoggerService);
logger.log('Switching logger', 'AppBootstrap'); logger.log('Switching logger', 'AppBootstrap');
app.useLogger(logger); app.useLogger(logger);
const notesService: NotesService = moduleRef.get('NotesService'); const notesService: NotesService = moduleRef.get(NotesService);
await notesService.createNote('test content', 'test_upload_media'); await notesService.createNote('test content', 'test_upload_media');
const userService: UsersService = moduleRef.get('UsersService'); const userService: UsersService = moduleRef.get(UsersService);
await userService.createUser('hardcoded', 'Testy'); await userService.createUser('hardcoded', 'Testy');
}); });

View file

@ -68,9 +68,9 @@ describe('Media', () => {
const logger = await app.resolve(ConsoleLoggerService); const logger = await app.resolve(ConsoleLoggerService);
logger.log('Switching logger', 'AppBootstrap'); logger.log('Switching logger', 'AppBootstrap');
app.useLogger(logger); app.useLogger(logger);
const notesService: NotesService = moduleRef.get('NotesService'); const notesService: NotesService = moduleRef.get(NotesService);
await notesService.createNote('test content', 'test_upload_media'); await notesService.createNote('test content', 'test_upload_media');
mediaService = moduleRef.get('MediaService'); mediaService = moduleRef.get(MediaService);
}); });
describe('POST /media', () => { describe('POST /media', () => {