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

consider jest mock of `sentry-X` as example docs or module #44

Closed zivl closed 3 years ago

zivl commented 4 years ago

as suggested by @dcramer in https://github.com/getsentry/sentry/pull/16116/files#diff-aa34cb9acf9a36938078d3c80d01a25a it might be a good pattern to mock sentry TOGETHER with the testkit

jest.mock('@sentry/browser', () => {
    ...Sentry,
   testkit,
   init: options =>
       SentryBrowser.init({ ...options, transport: sentryTransport  })
})
zivl commented 3 years ago

solved here https://github.com/wix/sentry-testkit/commit/80e602c2597464c80721993e73c251d65b03ad22