@@ -159,13 +159,13 @@ describe('JSE Error detection in various callbacks', () => {
159
159
{ message : 'Unhandled Promise Rejection: [1,2,3]' , meta : 'array' } ,
160
160
{ message : 'Unhandled Promise Rejection: test' , meta : 'error with message' } ,
161
161
{ message : 'test' , meta : 'error with no setter with message' } ,
162
- { message : 'Unhandled Promise Rejection' , meta : 'undefined' } ,
163
- { message : 'Unhandled Promise Rejection: null' , meta : 'null' } ,
164
162
{ message : 'Unhandled Promise Rejection: ' , meta : 'error with no message' } ,
165
163
{ message : 'Unhandled Promise Rejection: {}' , meta : 'map object' } ,
166
164
{ message : 'Unhandled Promise Rejection: {"abc":"Hello"}' , meta : 'factory function' } ,
167
165
{ message : 'Unhandled Promise Rejection: ' , meta : 'uncalled function' } ,
168
- { message : 'Unhandled Promise Rejection: {"abc":"circular"}' , meta : 'circular object' }
166
+ { message : 'Unhandled Promise Rejection: {"abc":"circular"}' , meta : 'circular object' } ,
167
+ { message : 'Unhandled Promise Rejection: test' , meta : 'thrown error' } ,
168
+ { message : 'Unhandled Promise Rejection: test' , meta : 'thrown error in nested fn' }
169
169
]
170
170
expectedErrorMessages . forEach ( expected => {
171
171
it ( 'should report unhandledPromiseRejections that are readable - ' + expected . meta , async ( ) => {
@@ -189,6 +189,17 @@ describe('JSE Error detection in various callbacks', () => {
189
189
} )
190
190
} )
191
191
192
+ it ( 'should not report unhandled rejections with falsy reasons' , async ( ) => {
193
+ const pageUrl = await browser . testHandle . assetURL ( 'unhandled-promise-rejection-falsy-reason.html' )
194
+ const [ errorsExpect ] = await Promise . all ( [
195
+ errorsCapture . waitForResult ( { timeout : 10000 } ) ,
196
+ browser . url ( pageUrl )
197
+ . then ( ( ) => browser . waitForAgentLoad ( ) )
198
+ ] )
199
+
200
+ expect ( errorsExpect ) . toEqual ( [ ] )
201
+ } )
202
+
192
203
it ( 'should report errors from XHR callbacks' , async ( ) => {
193
204
const pageUrl = await browser . testHandle . assetURL ( 'xhr-error.html' )
194
205
const [ [ { request : { body : errorBody , query : errorQuery } } ] ] = await Promise . all ( [
0 commit comments