Skip to content

Commit

Permalink
Update value shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Oct 23, 2020
1 parent 1627ab5 commit 90ef848
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
8 changes: 4 additions & 4 deletions packages/next/telemetry/events/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ type EventCliSessionStarted = {
basePathEnabled: boolean
i18nEnabled: boolean
imageEnabled: boolean
locales: string[] | null
locales: string | null
localeDomainsCount: number | null
localeDetectionEnabled: boolean | null
imageDomainsCount: number | null
imageSizes: number[] | null
imageSizes: string | null
imageLoader: string | null
trailingSlashEnabled: boolean
reactStrictMode: boolean
Expand Down Expand Up @@ -131,11 +131,11 @@ export function eventCliSession(
imageEnabled: !!images,
basePathEnabled: !!userConfiguration?.basePath,
i18nEnabled: !!i18n,
locales: i18n?.locales || null,
locales: i18n?.locales ? i18n.locales.join(',') : null,
localeDomainsCount: i18n?.domains ? i18n.domains.length : null,
localeDetectionEnabled: !i18n ? null : i18n.localeDetection !== false,
imageDomainsCount: images?.domains ? images.domains.length : null,
imageSizes: images?.sizes || null,
imageSizes: images?.sizes ? images.sizes.join(',') : null,
imageLoader: images?.loader,
trailingSlashEnabled: !!userConfiguration?.trailingSlash,
reactStrictMode: !!userConfiguration?.reactStrictMode,
Expand Down
17 changes: 5 additions & 12 deletions test/integration/telemetry/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,13 @@ describe('Telemetry CLI', () => {
const event1 = /NEXT_CLI_SESSION_STARTED[\s\S]+?{([\s\S]+?)}/
.exec(stderr)
.pop()

expect(event1).toMatch(/"i18nEnabled": true/)
expect(event1).toMatch(
/"locales":.*?\[\s{0,}"en",\s{0,}"nl",\s{0,}"fr"\s{0,}\]/m
)
expect(event1).toMatch(/"locales": "en,nl,fr"/)
expect(event1).toMatch(/"localeDomainsCount": 2/)
expect(event1).toMatch(/"localeDetectionEnabled": true/)
expect(event1).toMatch(/"imageDomainsCount": 1/)
expect(event1).toMatch(
/"imageSizes":.*?\[\s{0,}64,\s{0,}128,\s{0,}256,\s{0,}512,\s{0,}1024\s{0,}\]/m
)
expect(event1).toMatch(/"imageSizes": "64,128,256,512,1024"/)
expect(event1).toMatch(/"trailingSlashEnabled": false/)
expect(event1).toMatch(/"reactStrictMode": false/)

Expand Down Expand Up @@ -502,15 +499,11 @@ describe('Telemetry CLI', () => {
.exec(stderr2)
.pop()
expect(event2).toMatch(/"i18nEnabled": true/)
expect(event2).toMatch(
/"locales":.*?\[\s{0,}"en",\s{0,}"nl",\s{0,}"fr"\s{0,}\]/m
)
expect(event2).toMatch(/"locales": "en,nl,fr"/)
expect(event2).toMatch(/"localeDomainsCount": 2/)
expect(event2).toMatch(/"localeDetectionEnabled": true/)
expect(event2).toMatch(/"imageDomainsCount": 1/)
expect(event2).toMatch(
/"imageSizes":.*?\[\s{0,}64,\s{0,}128,\s{0,}256,\s{0,}512,\s{0,}1024\s{0,}\]/m
)
expect(event2).toMatch(/"imageSizes": "64,128,256,512,1024"/)
expect(event2).toMatch(/"trailingSlashEnabled": false/)
expect(event2).toMatch(/"reactStrictMode": false/)
})
Expand Down

0 comments on commit 90ef848

Please sign in to comment.