Skip to content

Commit

Permalink
simplify proxy assignment in proxy handler mock
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Aug 21, 2020
1 parent 850e83d commit 97917a1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/plugins/console/server/__tests__/proxy_route/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface MockDepsArgument extends Partial<Omit<RouteDependencies, 'proxy'>> {
}

export const getProxyRouteHandlerDeps = ({
proxy = defaultProxyValue,
proxy,
log = coreMock.createPluginInitializerContext().logger.get(),
router = httpServiceMock.createSetupContract().createRouter(),
}: MockDepsArgument): RouteDependencies => {
Expand All @@ -55,13 +55,12 @@ export const getProxyRouteHandlerDeps = ({
return {
services,
router,
proxy:
defaultProxyValue !== proxy
? {
...defaultProxyValue,
...proxy,
}
: defaultProxyValue,
proxy: proxy
? {
...defaultProxyValue,
...proxy,
}
: defaultProxyValue,
log,
};
};

0 comments on commit 97917a1

Please sign in to comment.