[ci] format
This commit is contained in:
parent
9c8a7c0b09
commit
44ba4e1ed9
2 changed files with 9 additions and 17 deletions
|
@ -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 }];
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue