From: Kai Moritz Date: Sat, 11 Oct 2025 11:53:24 +0000 (+0200) Subject: refactor: switched back to simpler syntax with `lastValueFrom()` X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=5e6381a9201355e091a707c9d6d93a61af69b517;p=demos%2Fkafka%2Fchat refactor: switched back to simpler syntax with `lastValueFrom()` --- diff --git a/src/app/chatroom/chatroom.service.pact.spec.ts b/src/app/chatroom/chatroom.service.pact.spec.ts index 511c1ded..57c3bf72 100644 --- a/src/app/chatroom/chatroom.service.pact.spec.ts +++ b/src/app/chatroom/chatroom.service.pact.spec.ts @@ -46,19 +46,9 @@ describe('Pact between the ChatroomService and the backend', () => { }); const service = TestBed.inject(ChatroomService); + const chatrooms = await lastValueFrom(service.getChatrooms()); - return new Promise((resolve, reject) => { - - service - .getChatrooms() - .subscribe({ - next: (chatrooms) => { - expect(chatrooms).toContainEqual(EXAMPLE_CHATROOM); - resolve(); - }, - error: (error) => reject(error), - }); - }); + expect(chatrooms).toContainEqual(EXAMPLE_CHATROOM); }); }); });