zivl / sentry-testkit

A Sentry plugin to allow Sentry report interception and further inspection of the data being sent
https://zivl.github.io/sentry-testkit/
MIT License
112 stars 26 forks source link

[BUG]: Testkit.reset doesn't clear event state and fingerprints #86

Closed imagoiq closed 2 years ago

imagoiq commented 3 years ago

Describe the bug With the latest Sentry version 6.8.0 and the dedupe integration (https://github.com/getsentry/sentry-javascript/pull/3730), it's not possible to have a duplicated error. Testkit.reset() should allow to duplicate an error by resetting state and fingerprints as well.

To Reproduce

  test('should testkit reset clear state and fingerprints', async function() {
    const error = new Error('simple error')

    Sentry.captureException(error)
    await waitForExpect(() => expect(testkit.reports()).toHaveLength(1))
    expect(testkit.isExist(error)).toBe(true)

    testkit.reset() // Should remove state and fingerprints

    Sentry.captureException(error)
    await waitForExpect(() => expect(testkit.reports()).toHaveLength(1))
    expect(testkit.isExist(error)).toBe(true)
  })

Sentry Versions (please complete the following information):

github-actions[bot] commented 2 years ago

Stale issue message