@@ -6,6 +6,8 @@ import { TestClient } from '../mocks/client';
66
77declare var global : any ;
88
9+ const PUBLIC_DSN = 'https://username@domain/path' ;
10+
911jest . mock ( '@sentry/hub' , ( ) => ( {
1012 getCurrentHub ( ) : {
1113 bindClient ( ) : boolean ;
@@ -42,7 +44,7 @@ describe('SDK', () => {
4244 new MockIntegration ( 'MockIntegration 1' ) ,
4345 new MockIntegration ( 'MockIntegration 2' ) ,
4446 ] ;
45- initAndBind ( TestClient , { defaultIntegrations : DEFAULT_INTEGRATIONS } ) ;
47+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , defaultIntegrations : DEFAULT_INTEGRATIONS } ) ;
4648 expect ( ( DEFAULT_INTEGRATIONS [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
4749 expect ( ( DEFAULT_INTEGRATIONS [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
4850 } ) ;
@@ -52,7 +54,7 @@ describe('SDK', () => {
5254 new MockIntegration ( 'MockIntegration 1' ) ,
5355 new MockIntegration ( 'MockIntegration 2' ) ,
5456 ] ;
55- initAndBind ( TestClient , { defaultIntegrations : false } ) ;
57+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , defaultIntegrations : false } ) ;
5658 expect ( ( DEFAULT_INTEGRATIONS [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 0 ) ;
5759 expect ( ( DEFAULT_INTEGRATIONS [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 0 ) ;
5860 } ) ;
@@ -62,7 +64,7 @@ describe('SDK', () => {
6264 new MockIntegration ( 'MockIntegration 1' ) ,
6365 new MockIntegration ( 'MockIntegration 2' ) ,
6466 ] ;
65- initAndBind ( TestClient , { integrations } ) ;
67+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , integrations } ) ;
6668 expect ( ( integrations [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
6769 expect ( ( integrations [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
6870 } ) ;
@@ -76,7 +78,7 @@ describe('SDK', () => {
7678 new MockIntegration ( 'MockIntegration 1' ) ,
7779 new MockIntegration ( 'MockIntegration 3' ) ,
7880 ] ;
79- initAndBind ( TestClient , { defaultIntegrations : DEFAULT_INTEGRATIONS , integrations } ) ;
81+ initAndBind ( TestClient , { dsn : PUBLIC_DSN , defaultIntegrations : DEFAULT_INTEGRATIONS , integrations } ) ;
8082 // 'MockIntegration 1' should be overridden by the one with the same name provided through options
8183 expect ( ( DEFAULT_INTEGRATIONS [ 0 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 0 ) ;
8284 expect ( ( DEFAULT_INTEGRATIONS [ 1 ] . setupOnce as jest . Mock ) . mock . calls . length ) . toBe ( 1 ) ;
@@ -91,6 +93,7 @@ describe('SDK', () => {
9193 ] ;
9294 const newIntegration = new MockIntegration ( 'MockIntegration 3' ) ;
9395 initAndBind ( TestClient , {
96+ dsn : PUBLIC_DSN ,
9497 // Take only the first one and add a new one to it
9598 defaultIntegrations : DEFAULT_INTEGRATIONS ,
9699 integrations : ( integrations : Integration [ ] ) => integrations . slice ( 0 , 1 ) . concat ( newIntegration ) ,
0 commit comments