[ci] format

This commit is contained in:
matthewp 2022-06-16 18:54:57 +00:00 committed by github-actions[bot]
parent 9c8a7c0b09
commit 44ba4e1ed9
2 changed files with 9 additions and 17 deletions

View file

@ -103,13 +103,13 @@ export function eventCliSession(
trailingSlash: userConfig?.trailingSlash,
build: userConfig?.build
? {
format: userConfig?.build?.format,
format: userConfig?.build?.format,
}
: undefined,
markdown: userConfig?.markdown
? {
mode: userConfig?.markdown?.mode,
syntaxHighlight: userConfig.markdown?.syntaxHighlight,
mode: userConfig?.markdown?.mode,
syntaxHighlight: userConfig.markdown?.syntaxHighlight,
}
: undefined,
}
@ -129,7 +129,7 @@ export function eventCliSession(
config: configValues,
flags: cliFlags,
// Optional integrations
optionalIntegrations: userConfig?.integrations?.length - integrations?.length
optionalIntegrations: userConfig?.integrations?.length - integrations?.length,
};
return [{ eventName: EVENT_SESSION, payload }];
}

View file

@ -415,11 +415,7 @@ describe('Session event', () => {
it('optional/conditional integrations', () => {
const config = {
srcDir: 1,
integrations: [
null,
undefined,
{ name: "example-integration" }
]
integrations: [null, undefined, { name: 'example-integration' }],
};
const [{ payload }] = events.eventCliSession(
{
@ -428,18 +424,14 @@ describe('Session event', () => {
},
config
);
expect(payload.config.integrations).deep.equal(["example-integration"]);
expect(payload.config.integrations).deep.equal(['example-integration']);
expect(payload.optionalIntegrations).to.equal(2);
});
});
it('falsy integrations', () => {
const config = {
srcDir: 1,
integrations: [
null,
undefined,
false
]
integrations: [null, undefined, false],
};
const [{ payload }] = events.eventCliSession(
{