@@ -6,6 +6,8 @@ import { TestClient } from '../mocks/client';
6
6
7
7
declare var global : any ;
8
8
9
+ const PUBLIC_DSN = 'https://username@domain/path' ;
10
+
9
11
jest . mock ( '@sentry/hub' , ( ) => ( {
10
12
getCurrentHub ( ) : {
11
13
bindClient ( ) : boolean ;
@@ -42,7 +44,7 @@ describe('SDK', () => {
42
44
new MockIntegration ( 'MockIntegration 1' ) ,
43
45
new MockIntegration ( 'MockIntegration 2' ) ,
44
46
] ;
45
- initAndBind ( TestClient , { defaultIntegrations : DEFAULT_INTEGRATIONS } ) ;
47
+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , defaultIntegrations : DEFAULT_INTEGRATIONS } ) ;
46
48
expect ( ( DEFAULT_INTEGRATIONS [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
47
49
expect ( ( DEFAULT_INTEGRATIONS [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
48
50
} ) ;
@@ -52,7 +54,7 @@ describe('SDK', () => {
52
54
new MockIntegration ( 'MockIntegration 1' ) ,
53
55
new MockIntegration ( 'MockIntegration 2' ) ,
54
56
] ;
55
- initAndBind ( TestClient , { defaultIntegrations : false } ) ;
57
+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , defaultIntegrations : false } ) ;
56
58
expect ( ( DEFAULT_INTEGRATIONS [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 0 ) ;
57
59
expect ( ( DEFAULT_INTEGRATIONS [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 0 ) ;
58
60
} ) ;
@@ -62,7 +64,7 @@ describe('SDK', () => {
62
64
new MockIntegration ( 'MockIntegration 1' ) ,
63
65
new MockIntegration ( 'MockIntegration 2' ) ,
64
66
] ;
65
- initAndBind ( TestClient , { integrations } ) ;
67
+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , integrations } ) ;
66
68
expect ( ( integrations [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
67
69
expect ( ( integrations [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
68
70
} ) ;
@@ -76,7 +78,7 @@ describe('SDK', () => {
76
78
new MockIntegration ( 'MockIntegration 1' ) ,
77
79
new MockIntegration ( 'MockIntegration 3' ) ,
78
80
] ;
79
- initAndBind ( TestClient , { defaultIntegrations : DEFAULT_INTEGRATIONS , integrations } ) ;
81
+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , defaultIntegrations : DEFAULT_INTEGRATIONS , integrations } ) ;
80
82
// 'MockIntegration 1' should be overridden by the one with the same name provided through options
81
83
expect ( ( DEFAULT_INTEGRATIONS [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 0 ) ;
82
84
expect ( ( DEFAULT_INTEGRATIONS [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
@@ -91,6 +93,7 @@ describe('SDK', () => {
91
93
] ;
92
94
const newIntegration = new MockIntegration ( 'MockIntegration 3' ) ;
93
95
initAndBind ( TestClient , {
96
+ dsn : PUBLIC_DSN ,
94
97
// Take only the first one and add a new one to it
95
98
defaultIntegrations : DEFAULT_INTEGRATIONS ,
96
99
integrations : ( integrations : Integration [ ] ) => integrations . slice ( 0 , 1 ) . concat ( newIntegration ) ,
0 commit comments