From 44ba4e1ed9926f66795b8950c1464488b8756b2f Mon Sep 17 00:00:00 2001 From: matthewp Date: Thu, 16 Jun 2022 18:54:57 +0000 Subject: [PATCH] [ci] format --- packages/telemetry/src/events/session.ts | 8 ++++---- packages/telemetry/test/session-event.test.js | 18 +++++------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/packages/telemetry/src/events/session.ts b/packages/telemetry/src/events/session.ts index babd09e55..e8c222bf1 100644 --- a/packages/telemetry/src/events/session.ts +++ b/packages/telemetry/src/events/session.ts @@ -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 }]; } diff --git a/packages/telemetry/test/session-event.test.js b/packages/telemetry/test/session-event.test.js index 07b214c30..5702f5fa5 100644 --- a/packages/telemetry/test/session-event.test.js +++ b/packages/telemetry/test/session-event.test.js @@ -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( {