Skip to content

Commit 8e74c47

Browse files
authored
chore(telemetry): add is_compass_web to tracking event types (#6596)
* chore(telemetry): add is_compass_web to tracking event types * chore: fix types in test
1 parent 0e85db1 commit 8e74c47

File tree

2 files changed

+175
-159
lines changed

2 files changed

+175
-159
lines changed

packages/compass-telemetry/src/index.spec.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import { createIpcTrack } from './';
22
import { expect } from 'chai';
33

4+
// So that we don't need to override types in all tests
5+
function createTrackFn() {
6+
return createIpcTrack() as (name: string, ...args: any[]) => void;
7+
}
8+
49
describe('Telemetry', () => {
510
it('sends track events over ipc', async function () {
6-
const track = createIpcTrack();
11+
const track = createTrackFn();
712

813
const trackingLogs: any[] = [];
914
process.on('compass:track', (event) => trackingLogs.push(event));
1015

11-
track('Test Event1' as any, {
16+
track('Test Event1', {
1217
some_attribute: 123,
1318
});
1419

@@ -25,12 +30,12 @@ describe('Telemetry', () => {
2530
});
2631

2732
it('resolves track event attributes', async function () {
28-
const track = createIpcTrack();
33+
const track = createTrackFn();
2934

3035
const trackingLogs: any[] = [];
3136
process.on('compass:track', (event) => trackingLogs.push(event));
3237

33-
track('Test Event2' as any, async () => {
38+
track('Test Event2', async () => {
3439
await new Promise((resolve) => setTimeout(resolve, 3));
3540

3641
return {
@@ -52,12 +57,12 @@ describe('Telemetry', () => {
5257
});
5358

5459
it('tracks events even when fetching the attributes fails', async function () {
55-
const track = createIpcTrack();
60+
const track = createTrackFn();
5661

5762
const trackingLogs: any[] = [];
5863
process.on('compass:track', (event) => trackingLogs.push(event));
5964

60-
track('Test Event3' as any, () => {
65+
track('Test Event3', () => {
6166
throw new Error('test error');
6267
});
6368

0 commit comments

Comments
 (0)