File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import * as SentryBrowser from '@sentry/browser';
22import { version } from 'react' ;
33import { init } from '../src/sdk' ;
44
5+ jest . mock ( '@sentry/browser' , ( ) => {
6+ return {
7+ __esModule : true ,
8+ ...jest . requireActual ( '@sentry/browser' ) ,
9+ } ;
10+ } ) ;
11+
512describe ( 'init' , ( ) => {
613 it ( 'sets the React version (if available) in the global scope' , ( ) => {
714 const setContextSpy = jest . spyOn ( SentryBrowser , 'setContext' ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import * as SentryReact from '@sentry/react';
22
33import { init } from '../src/index.client' ;
44
5+ jest . mock ( '@sentry/react' , ( ) => {
6+ return {
7+ __esModule : true ,
8+ ...jest . requireActual ( '@sentry/react' ) ,
9+ } ;
10+ } ) ;
11+
512const reactInit = jest . spyOn ( SentryReact , 'init' ) ;
613
714describe ( 'Client init()' , ( ) => {
Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import * as SentryNode from '@sentry/node';
22
33import { init } from '../src/index.server' ;
44
5+ jest . mock ( '@sentry/node' , ( ) => {
6+ return {
7+ __esModule : true ,
8+ ...jest . requireActual ( '@sentry/node' ) ,
9+ } ;
10+ } ) ;
11+
512const nodeInit = jest . spyOn ( SentryNode , 'init' ) ;
613
714describe ( 'Server init()' , ( ) => {
You can’t perform that action at this time.
0 commit comments