avoid overusing fancy constructs

Signed-off-by: Erik Larsson <erik.larsson@schibsted.com>
This commit is contained in:
Erik Larsson
2021-04-17 19:31:22 +02:00
parent 1d2fafca72
commit 3f4c4a00dd
2 changed files with 8 additions and 5 deletions
@@ -84,10 +84,13 @@ describe('catalog:register', () => {
catalogInfoUrl: 'http://foo/var',
},
});
expect(addLocation).toBeCalledWith({
type: 'url',
target: 'http://foo/var',
});
expect(addLocation).toBeCalledWith(
{
type: 'url',
target: 'http://foo/var',
},
{},
);
expect(mockContext.output).toBeCalledWith(
'entityRef',
@@ -100,7 +100,7 @@ export function createCatalogRegisterAction(options: {
type: 'url',
target: catalogInfoUrl,
},
...(ctx.token ? [{ token: ctx.token }] : []),
ctx.token ? { token: ctx.token } : {},
);
if (result.entities.length >= 1) {
const { kind, name, namespace } = getEntityName(result.entities[0]);