[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,
|
trailingSlash: userConfig?.trailingSlash,
|
||||||
build: userConfig?.build
|
build: userConfig?.build
|
||||||
? {
|
? {
|
||||||
format: userConfig?.build?.format,
|
format: userConfig?.build?.format,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
markdown: userConfig?.markdown
|
markdown: userConfig?.markdown
|
||||||
? {
|
? {
|
||||||
mode: userConfig?.markdown?.mode,
|
mode: userConfig?.markdown?.mode,
|
||||||
syntaxHighlight: userConfig.markdown?.syntaxHighlight,
|
syntaxHighlight: userConfig.markdown?.syntaxHighlight,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ export function eventCliSession(
|
||||||
config: configValues,
|
config: configValues,
|
||||||
flags: cliFlags,
|
flags: cliFlags,
|
||||||
// Optional integrations
|
// Optional integrations
|
||||||
optionalIntegrations: userConfig?.integrations?.length - integrations?.length
|
optionalIntegrations: userConfig?.integrations?.length - integrations?.length,
|
||||||
};
|
};
|
||||||
return [{ eventName: EVENT_SESSION, payload }];
|
return [{ eventName: EVENT_SESSION, payload }];
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,11 +415,7 @@ describe('Session event', () => {
|
||||||
it('optional/conditional integrations', () => {
|
it('optional/conditional integrations', () => {
|
||||||
const config = {
|
const config = {
|
||||||
srcDir: 1,
|
srcDir: 1,
|
||||||
integrations: [
|
integrations: [null, undefined, { name: 'example-integration' }],
|
||||||
null,
|
|
||||||
undefined,
|
|
||||||
{ name: "example-integration" }
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
const [{ payload }] = events.eventCliSession(
|
const [{ payload }] = events.eventCliSession(
|
||||||
{
|
{
|
||||||
|
@ -428,18 +424,14 @@ describe('Session event', () => {
|
||||||
},
|
},
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
expect(payload.config.integrations).deep.equal(["example-integration"]);
|
expect(payload.config.integrations).deep.equal(['example-integration']);
|
||||||
expect(payload.optionalIntegrations).to.equal(2);
|
expect(payload.optionalIntegrations).to.equal(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('falsy integrations', () => {
|
it('falsy integrations', () => {
|
||||||
const config = {
|
const config = {
|
||||||
srcDir: 1,
|
srcDir: 1,
|
||||||
integrations: [
|
integrations: [null, undefined, false],
|
||||||
null,
|
|
||||||
undefined,
|
|
||||||
false
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
const [{ payload }] = events.eventCliSession(
|
const [{ payload }] = events.eventCliSession(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue