From 6768fc06b5330cd51e3f83ddcf7f9e5a38f88a3e Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Wed, 19 Aug 2020 16:37:35 +0200 Subject: [PATCH] fix another type issue --- src/plugins/console/server/__tests__/proxy_route/mocks.ts | 2 +- .../console/server/__tests__/proxy_route/params.test.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/console/server/__tests__/proxy_route/mocks.ts b/src/plugins/console/server/__tests__/proxy_route/mocks.ts index c11d658b2e718..0854d69bb4255 100644 --- a/src/plugins/console/server/__tests__/proxy_route/mocks.ts +++ b/src/plugins/console/server/__tests__/proxy_route/mocks.ts @@ -39,7 +39,7 @@ const defaultProxyValue = Object.freeze({ }); interface MockDepsArgument extends Partial> { - proxy: Partial; + proxy?: Partial; } export const getProxyRouteHandlerDeps = ({ diff --git a/src/plugins/console/server/__tests__/proxy_route/params.test.ts b/src/plugins/console/server/__tests__/proxy_route/params.test.ts index 8f61f95827a23..e1c5295f6d30f 100644 --- a/src/plugins/console/server/__tests__/proxy_route/params.test.ts +++ b/src/plugins/console/server/__tests__/proxy_route/params.test.ts @@ -51,7 +51,7 @@ describe('Console Proxy Route', () => { describe('one match', () => { it('allows the request', async () => { handler = createHandler( - getProxyRouteHandlerDeps({ pathFilters: [/^\/foo\//, /^\/bar\//] }) + getProxyRouteHandlerDeps({ proxy: { pathFilters: [/^\/foo\//, /^\/bar\//] } }) ); (requestModule.proxyRequest as jest.Mock).mockResolvedValue(createResponseStub('foo')); @@ -68,7 +68,9 @@ describe('Console Proxy Route', () => { }); describe('all match', () => { it('allows the request', async () => { - handler = createHandler(getProxyRouteHandlerDeps({ pathFilters: [/^\/foo\//] })); + handler = createHandler( + getProxyRouteHandlerDeps({ proxy: { pathFilters: [/^\/foo\//] } }) + ); (requestModule.proxyRequest as jest.Mock).mockResolvedValue(createResponseStub('foo'));