@@ -160,6 +160,7 @@ describe('InboundFilters', () => {
160160
161161 describe ( 'blacklistUrls/whitelistUrls' , ( ) => {
162162 const messageEvent = {
163+ message : 'wat' ,
163164 stacktrace : {
164165 frames : [
165166 {
@@ -195,6 +196,23 @@ describe('InboundFilters', () => {
195196 expect ( inboundFilters . isWhitelistedUrl ( messageEvent ) ) . equal ( true ) ;
196197 } ) ;
197198
199+ it ( 'should not filter captured messages with no stacktraces' , ( ) => {
200+ inboundFilters . install ( {
201+ blacklistUrls : [ 'https://awesome-analytics.io' ] ,
202+ whitelistUrls : [ 'https://awesome-analytics.io' ] ,
203+ } ) ;
204+ expect (
205+ inboundFilters . isBlacklistedUrl ( {
206+ message : 'any' ,
207+ } ) ,
208+ ) . equal ( false ) ;
209+ expect (
210+ inboundFilters . isWhitelistedUrl ( {
211+ message : 'any' ,
212+ } ) ,
213+ ) . equal ( true ) ;
214+ } ) ;
215+
198216 it ( 'should filter captured exception based on its stack trace using string filter' , ( ) => {
199217 inboundFilters . install ( {
200218 blacklistUrls : [ 'https://awesome-analytics.io' ] ,
@@ -231,7 +249,7 @@ describe('InboundFilters', () => {
231249 expect ( inboundFilters . isWhitelistedUrl ( exceptionEvent ) ) . equal ( true ) ;
232250 } ) ;
233251
234- it ( 'should not fail with malformed event event and default to false' , ( ) => {
252+ it ( 'should not fail with malformed event event and default to false for isBlacklistedUrl and true for isWhitelistedUrl ' , ( ) => {
235253 const malformedEvent = {
236254 stacktrace : {
237255 frames : undefined ,
@@ -242,7 +260,7 @@ describe('InboundFilters', () => {
242260 whitelistUrls : [ 'https://awesome-analytics.io' ] ,
243261 } ) ;
244262 expect ( inboundFilters . isBlacklistedUrl ( malformedEvent ) ) . equal ( false ) ;
245- expect ( inboundFilters . isWhitelistedUrl ( malformedEvent ) ) . equal ( false ) ;
263+ expect ( inboundFilters . isWhitelistedUrl ( malformedEvent ) ) . equal ( true ) ;
246264 } ) ;
247265 } ) ;
248266} ) ;
0 commit comments