Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Sep 27, 2023
1 parent a34dd1e commit b8080d8
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/__tests__/gdpr-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,22 +563,9 @@ describe(`GDPR utils`, () => {
})
})

it(`should call the wrapped method if an unexpected error occurs`, () => {
TOKENS.forEach((token) => {
setupMocks(() => {
throw new Error(`Unexpected error!`)
}, true)

gdpr.optIn(token, { persistenceType })
postHogLib.capture(captureEventName, captureProperties)

expect(capture.calledOnceWith(captureEventName, captureProperties)).toBe(true)
})
})

it(`should call the wrapped method if config is undefined`, () => {
TOKENS.forEach((token) => {
setupMocks(() => undefined, false)
setupMocks(undefined, false)
console.error = jest.fn()

gdpr.optIn(token, { persistenceType })
Expand Down

0 comments on commit b8080d8

Please sign in to comment.