@@ -17,7 +17,7 @@ import {
1717 wrap ,
1818} from '../../src' ;
1919import { getDefaultBrowserClientOptions } from './helper/browser-client-options' ;
20- import { SimpleTransport } from './mocks/simpletransport' ;
20+ import { makeSimpleTransport } from './mocks/simpletransport' ;
2121
2222const dsn = 'https://[email protected] /4291' ; 2323
@@ -31,7 +31,7 @@ describe('SentryBrowser', () => {
3131 init ( {
3232 beforeSend,
3333 dsn,
34- transport : SimpleTransport ,
34+ transport : makeSimpleTransport ,
3535 } ) ;
3636 } ) ;
3737
@@ -77,7 +77,7 @@ describe('SentryBrowser', () => {
7777 describe ( 'user' , ( ) => {
7878 const EX_USER = { email :
'[email protected] ' } ; 7979 const options = getDefaultBrowserClientOptions ( { dsn } ) ;
80- const client = new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ;
80+ const client = new BrowserClient ( options ) ;
8181 const reportDialogSpy = jest . spyOn ( client , 'showReportDialog' ) ;
8282
8383 beforeEach ( ( ) => {
@@ -150,7 +150,7 @@ describe('SentryBrowser', () => {
150150 } ,
151151 dsn,
152152 } ) ;
153- getCurrentHub ( ) . bindClient ( new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ) ;
153+ getCurrentHub ( ) . bindClient ( new BrowserClient ( options ) ) ;
154154 captureMessage ( 'test' ) ;
155155 } ) ;
156156
@@ -164,7 +164,7 @@ describe('SentryBrowser', () => {
164164 } ,
165165 dsn,
166166 } ) ;
167- getCurrentHub ( ) . bindClient ( new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ) ;
167+ getCurrentHub ( ) . bindClient ( new BrowserClient ( options ) ) ;
168168 captureEvent ( { message : 'event' } ) ;
169169 } ) ;
170170
@@ -175,7 +175,7 @@ describe('SentryBrowser', () => {
175175 dsn,
176176 integrations : [ ] ,
177177 } ) ;
178- getCurrentHub ( ) . bindClient ( new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ) ;
178+ getCurrentHub ( ) . bindClient ( new BrowserClient ( options ) ) ;
179179
180180 captureMessage ( 'event222' ) ;
181181 captureMessage ( 'event222' ) ;
@@ -192,7 +192,7 @@ describe('SentryBrowser', () => {
192192 dsn,
193193 integrations : [ new Integrations . InboundFilters ( { ignoreErrors : [ 'capture' ] } ) ] ,
194194 } ) ;
195- getCurrentHub ( ) . bindClient ( new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ) ;
195+ getCurrentHub ( ) . bindClient ( new BrowserClient ( options ) ) ;
196196
197197 captureMessage ( 'capture' ) ;
198198
@@ -244,7 +244,7 @@ describe('SentryBrowser initialization', () => {
244244 it ( 'should set SDK data when Sentry.init() is called' , ( ) => {
245245 init ( { dsn } ) ;
246246
247- const sdkData = ( getCurrentHub ( ) . getClient ( ) as any ) . getTransport ( ) . _api . metadata ? .sdk ;
247+ const sdkData = ( getCurrentHub ( ) . getClient ( ) as any ) . getOptions ( ) . _metadata . sdk ;
248248
249249 expect ( sdkData ?. name ) . toBe ( 'sentry.javascript.browser' ) ;
250250 expect ( sdkData ?. packages [ 0 ] . name ) . toBe ( 'npm:@sentry/browser' ) ;
@@ -254,9 +254,9 @@ describe('SentryBrowser initialization', () => {
254254
255255 it ( 'should set SDK data when instantiating a client directly' , ( ) => {
256256 const options = getDefaultBrowserClientOptions ( { dsn } ) ;
257- const client = new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ;
257+ const client = new BrowserClient ( options ) ;
258258
259- const sdkData = ( client . getTransport ( ) as any ) . _api . metadata ?. sdk ;
259+ const sdkData = client . getOptions ( ) . _metadata ?. sdk as any ;
260260
261261 expect ( sdkData . name ) . toBe ( 'sentry.javascript.browser' ) ;
262262 expect ( sdkData . packages [ 0 ] . name ) . toBe ( 'npm:@sentry/browser' ) ;
@@ -284,7 +284,7 @@ describe('SentryBrowser initialization', () => {
284284 } ,
285285 } ) ;
286286
287- const sdkData = ( getCurrentHub ( ) . getClient ( ) as any ) . getTransport ( ) . _api . metadata ?. sdk ;
287+ const sdkData = ( getCurrentHub ( ) . getClient ( ) as any ) . getOptions ( ) . _metadata ?. sdk ;
288288
289289 expect ( sdkData . name ) . toBe ( 'sentry.javascript.angular' ) ;
290290 expect ( sdkData . packages [ 0 ] . name ) . toBe ( 'npm:@sentry/angular' ) ;
@@ -305,7 +305,7 @@ describe('wrap()', () => {
305305 } ,
306306 dsn,
307307 } ) ;
308- getCurrentHub ( ) . bindClient ( new BrowserClient ( options , new SimpleTransport ( { dsn } ) ) ) ;
308+ getCurrentHub ( ) . bindClient ( new BrowserClient ( options ) ) ;
309309
310310 try {
311311 wrap ( ( ) => {
0 commit comments