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';
2
2
import { version } from 'react' ;
3
3
import { init } from '../src/sdk' ;
4
4
5
+ jest . mock ( '@sentry/browser' , ( ) => {
6
+ return {
7
+ __esModule : true ,
8
+ ...jest . requireActual ( '@sentry/browser' ) ,
9
+ } ;
10
+ } ) ;
11
+
5
12
describe ( 'init' , ( ) => {
6
13
it ( 'sets the React version (if available) in the global scope' , ( ) => {
7
14
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';
2
2
3
3
import { init } from '../src/index.client' ;
4
4
5
+ jest . mock ( '@sentry/react' , ( ) => {
6
+ return {
7
+ __esModule : true ,
8
+ ...jest . requireActual ( '@sentry/react' ) ,
9
+ } ;
10
+ } ) ;
11
+
5
12
const reactInit = jest . spyOn ( SentryReact , 'init' ) ;
6
13
7
14
describe ( 'Client init()' , ( ) => {
Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import * as SentryNode from '@sentry/node';
2
2
3
3
import { init } from '../src/index.server' ;
4
4
5
+ jest . mock ( '@sentry/node' , ( ) => {
6
+ return {
7
+ __esModule : true ,
8
+ ...jest . requireActual ( '@sentry/node' ) ,
9
+ } ;
10
+ } ) ;
11
+
5
12
const nodeInit = jest . spyOn ( SentryNode , 'init' ) ;
6
13
7
14
describe ( 'Server init()' , ( ) => {
You can’t perform that action at this time.
0 commit comments