From 12e2c1e12f450bc2e2ec4240ef037ba1d7de2f74 Mon Sep 17 00:00:00 2001 From: Simonas Karuzas Date: Mon, 15 Jun 2020 16:21:17 +0300 Subject: [PATCH] fix: Test daf-url --- .../daf-url/src/__tests__/message-handler.test.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/daf-url/src/__tests__/message-handler.test.ts b/packages/daf-url/src/__tests__/message-handler.test.ts index 7c12a6482..fb0e53bf3 100644 --- a/packages/daf-url/src/__tests__/message-handler.test.ts +++ b/packages/daf-url/src/__tests__/message-handler.test.ts @@ -6,16 +6,9 @@ fetchMock.enableMocks() describe('daf-url', () => { const messageHandler = new UrlMessageHandler() - const agent = new Agent({ - identityProviders: [], - serviceControllers: [], - didResolver: { resolve: jest.fn() }, - messageHandler, - }) - it('should reject unknown message type', async () => { const message = new Message({ raw: 'test', metaData: [{ type: 'test' }] }) - expect(messageHandler.handle(message, agent)).rejects.toEqual('Unsupported message type') + expect(messageHandler.handle(message, null)).rejects.toEqual('Unsupported message type') }) it('should transform message after standard URL', async () => { @@ -29,7 +22,7 @@ describe('daf-url', () => { }, ], }) - expect(messageHandler.handle(message, agent)).rejects.toEqual('Unsupported message type') + expect(messageHandler.handle(message, null)).rejects.toEqual('Unsupported message type') expect(message.raw).toEqual(JWT) }) @@ -38,7 +31,7 @@ describe('daf-url', () => { fetchMock.mockResponse('mockbody') expect.assertions(2) try { - await messageHandler.handle(message, agent) + await messageHandler.handle(message, null) } catch (e) { expect(e).toMatch('Unsupported message type') }