Fix telemetry reporting for integrations that return an array (#7429)
This commit is contained in:
parent
82b1964432
commit
89a4835202
3 changed files with 17 additions and 1 deletions
5
.changeset/witty-roses-relate.md
Normal file
5
.changeset/witty-roses-relate.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix telemetry reporting for integrations that return an array
|
|
@ -83,7 +83,10 @@ export function eventCliSession(
|
|||
) ?? []),
|
||||
] as string[],
|
||||
adapter: userConfig?.adapter?.name ?? null,
|
||||
integrations: (userConfig?.integrations ?? []).filter(Boolean).map((i: any) => i?.name),
|
||||
integrations: (userConfig?.integrations ?? [])
|
||||
.filter(Boolean)
|
||||
.flat()
|
||||
.map((i: any) => i?.name),
|
||||
trailingSlash: userConfig?.trailingSlash,
|
||||
build: userConfig?.build
|
||||
? {
|
||||
|
|
|
@ -385,6 +385,14 @@ describe('Events', () => {
|
|||
expect(payload.config.integrations.length).to.equal(0);
|
||||
});
|
||||
|
||||
it('finds names for integration arrays', () => {
|
||||
const config = {
|
||||
integrations: [{ name: 'foo' }, [{ name: 'bar' }, { name: 'baz' }]],
|
||||
};
|
||||
const [{ payload }] = events.eventCliSession({ cliCommand: 'dev' }, config);
|
||||
expect(payload.config.integrations).to.deep.equal(['foo', 'bar', 'baz']);
|
||||
});
|
||||
|
||||
it('includes cli flags in payload', () => {
|
||||
const config = {};
|
||||
const flags = {
|
||||
|
|
Loading…
Reference in a new issue