Skip to content

Commit

Permalink
Undo some changes now we're not using strict
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Aug 14, 2024
1 parent 0b88932 commit 3fce416
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/__tests__/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ describe('posthog core', () => {

const posthogWith = (config: Partial<PostHogConfig>, overrides?: Partial<PostHog>): PostHog => {
const posthog = defaultPostHog().init('testtoken', config, uuidv7())
if (!posthog) {
throw new Error('PostHog failed to initialize')
}
return Object.assign(posthog, overrides || {})
}

Expand Down Expand Up @@ -62,7 +59,7 @@ describe('posthog core', () => {
eventName,
{},
{ timestamp: new Date(2020, 0, 2, 12, 34) }
)!
)
expect(captureData).toHaveProperty('timestamp')
expect(captureData.timestamp).toEqual(new Date(2020, 0, 2, 12, 34))
expect(captureData.properties['$event_time_override_provided']).toEqual(true)
Expand Down Expand Up @@ -118,8 +115,8 @@ describe('posthog core', () => {

posthog.capture(eventName, {}, {})

expect(posthog.sessionPersistence?.update_campaign_params).toHaveBeenCalled()
expect(posthog.sessionPersistence?.update_referrer_info).toHaveBeenCalled()
expect(posthog.sessionPersistence.update_campaign_params).toHaveBeenCalled()
expect(posthog.sessionPersistence.update_referrer_info).toHaveBeenCalled()
})

it('errors with undefined event name', () => {
Expand Down Expand Up @@ -480,7 +477,7 @@ describe('posthog core', () => {
event: 'prop',
distinct_id: 'abc',
})
expect(posthog.sessionManager!.checkAndGetSessionAndWindowId).not.toHaveBeenCalled()
expect(posthog.sessionManager.checkAndGetSessionAndWindowId).not.toHaveBeenCalled()
})

it('calls sanitize_properties', () => {
Expand Down

0 comments on commit 3fce416

Please sign in to comment.