Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Dec 21, 2023
1 parent 3489500 commit 5d77206
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions posthog-react-native/test/posthog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,6 @@ describe('PostHog React Native', () => {
expect(posthog.getDistinctId()).toEqual('bar')
})

it('should initialize with in memory storage if no storage available or broken', async () => {
// preloadAsync calls getItem, getItem throws an error
const myBrokenStorageMock = (): PostHogCustomAsyncStorage => {
return {
async getItem(key: string) {
throw new Error(`error getting ${key}`)
},

async setItem(key: string, value: string) {
throw new Error(`error setting ${key} with the value ${value}`)
},
}
}

posthog = await PostHog.initAsync('test-token', {
bootstrap: { distinctId: 'bar' },
persistence: 'file',
customAsyncStorage: myBrokenStorageMock(),
flushInterval: 0,
})
expect(posthog.getAnonymousId()).toEqual('bar')
expect(posthog.getDistinctId()).toEqual('bar')
})

it('should allow customising of native app properties', async () => {
posthog = await PostHog.initAsync('test-token', {
customAppProperties: { $app_name: 'custom' },
Expand Down

0 comments on commit 5d77206

Please sign in to comment.