Update sentry-javascript monorepo to v6 (#41991)

* Update sentry-javascript monorepo to v6

* Pass fetch implementation to FetchTransport and stub in unit tests

* kick drone

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
renovate[bot]
2021-11-23 15:59:32 +00:00
committed by GitHub
parent 96b1776856
commit 0ab4afa2b7
6 changed files with 54 additions and 58 deletions

View File

@@ -13,7 +13,10 @@ import { GrafanaEdition } from '@grafana/data/src/types/config';
jest.mock('@sentry/browser');
describe('SentryEchoBackend', () => {
beforeEach(() => jest.resetAllMocks());
beforeEach(() => {
jest.resetAllMocks();
window.fetch = jest.fn();
});
const buildInfo: BuildInfo = {
version: '1.0',

View File

@@ -21,7 +21,7 @@ export class SentryEchoBackend implements EchoBackend<SentryEchoEvent, SentryEch
// set up transports to post events to grafana backend and/or Sentry
this.transports = [];
if (options.dsn) {
this.transports.push(new FetchTransport({ dsn: options.dsn }));
this.transports.push(new FetchTransport({ dsn: options.dsn }, fetch));
}
if (options.customEndpoint) {
this.transports.push(new CustomEndpointTransport({ endpoint: options.customEndpoint }));