File tree Expand file tree Collapse file tree 2 files changed +254
-414
lines changed
packages/browser/test/integration Expand file tree Collapse file tree 2 files changed +254
-414
lines changed Original file line number Diff line number Diff line change 87
87
</ script >
88
88
< script src ="../../build/bundle.js "> </ script >
89
89
< script >
90
- // stub _makeRequest so we don't actually transmit any data
91
- Raven . _makeRequest = function ( ) { } ;
92
-
93
90
// store references to original, unwrapped built-ins in order to:
94
91
// - get a clean, unwrapped setTimeout (so stack traces don't include
95
92
// frames from mocha)
108
105
consoleLog : console . log
109
106
} ;
110
107
111
- window . ravenData = [ ] ;
112
- Raven . config ( 'https://[email protected] /1' , {
113
- dataCallback : function ( data ) {
114
- ravenData . push ( data ) ;
108
+ // expose events so we can access them in our tests
109
+ window . sentryData = [ ] ;
110
+
111
+ // stub transport so we don't actually transmit any data
112
+ function DummyTransport ( ) { }
113
+ DummyTransport . prototype . send = function ( event ) {
114
+ // console.log(JSON.stringify(event, null, 2));
115
+ sentryData . push ( event ) ;
116
+ return true ;
117
+ }
118
+
119
+ Sentry . init ( {
120
+ dsn :
'https://[email protected] /1' ,
121
+ transport : DummyTransport ,
122
+ shouldAddBreadcrumb : function ( breadcrumb ) {
123
+ // Filter internal Karma requests
124
+ if (
125
+ breadcrumb . type === 'http' &&
126
+ (
127
+ breadcrumb . data . url . indexOf ( 'test.js' ) !== - 1 ||
128
+ breadcrumb . data . url . indexOf ( 'frame.html' ) !== - 1
129
+ )
130
+ ) {
131
+ return false ;
132
+ }
133
+ return true ;
115
134
}
116
- } ) . install ( ) ;
135
+ } )
117
136
118
137
function bar ( ) {
119
138
baz ( ) ;
You can’t perform that action at this time.
0 commit comments