From a8d6b33139382e51f79fa2d6ba9a34605ed292f7 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Thu, 15 Jul 2021 20:30:51 +0200 Subject: [PATCH] [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 --- test/private-api/media.e2e-spec.ts | 4 ++-- test/public-api/media.e2e-spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/private-api/media.e2e-spec.ts b/test/private-api/media.e2e-spec.ts index 2a78cd028..8639616a9 100644 --- a/test/private-api/media.e2e-spec.ts +++ b/test/private-api/media.e2e-spec.ts @@ -71,9 +71,9 @@ describe('Media', () => { const logger = await app.resolve(ConsoleLoggerService); logger.log('Switching logger', 'AppBootstrap'); app.useLogger(logger); - const notesService: NotesService = moduleRef.get('NotesService'); + const notesService: NotesService = moduleRef.get(NotesService); 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'); }); diff --git a/test/public-api/media.e2e-spec.ts b/test/public-api/media.e2e-spec.ts index af6f558e9..2b8df0b85 100644 --- a/test/public-api/media.e2e-spec.ts +++ b/test/public-api/media.e2e-spec.ts @@ -68,9 +68,9 @@ describe('Media', () => { const logger = await app.resolve(ConsoleLoggerService); logger.log('Switching logger', 'AppBootstrap'); app.useLogger(logger); - const notesService: NotesService = moduleRef.get('NotesService'); + const notesService: NotesService = moduleRef.get(NotesService); await notesService.createNote('test content', 'test_upload_media'); - mediaService = moduleRef.get('MediaService'); + mediaService = moduleRef.get(MediaService); }); describe('POST /media', () => {