File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 7070 _window [ _onerror ] = _oldOnerror ;
7171 _window [ _onunhandledrejection ] = _oldOnunhandledrejection ;
7272
73+ // Add loader as SDK source
74+ _window . SENTRY_SDK_SOURCE = 'loader' ;
75+
7376 var SDK = _window [ _namespace ] ;
7477
7578 var oldInit = SDK . init ;
Original file line number Diff line number Diff line change @@ -49,5 +49,21 @@ if (IS_LOADER) {
4949 assert . equal ( summary . events [ 0 ] . breadcrumbs [ 0 ] . message , 'testing loader' ) ;
5050 } ) ;
5151 } ) ;
52+
53+ it ( 'should set SENTRY_SDK_SOURCE value' , ( ) => {
54+ return runInSandbox ( sandbox , function ( ) {
55+ Sentry . onLoad ( function ( ) {
56+ Sentry . init ( { debug : true } ) ;
57+ } ) ;
58+ setTimeout ( function ( ) {
59+ Sentry . captureMessage ( 'test' ) ;
60+ } ) ;
61+ undefinedMethod ( ) ; // trigger error
62+ } ) . then ( function ( summary ) {
63+ if ( IS_LOADER ) {
64+ assert . equal ( summary . events [ 0 ] . sdk . packages [ 0 ] . name , 'loader:@sentry/browser' ) ;
65+ }
66+ } ) ;
67+ } ) ;
5268 } ) ;
5369}
You can’t perform that action at this time.
0 commit comments