@@ -112,7 +112,7 @@ asyncTest('synchronously rejected promise should trigger' +
112
112
' unhandledRejection' , function ( done ) {
113
113
const e = new Error ( ) ;
114
114
onUnhandledSucceed ( done , function ( reason , promise ) {
115
- assert . strictEqual ( e , reason ) ;
115
+ assert . strictEqual ( reason , e ) ;
116
116
} ) ;
117
117
Promise . reject ( e ) ;
118
118
} ) ;
@@ -121,7 +121,7 @@ asyncTest('synchronously rejected promise should trigger' +
121
121
' unhandledRejection' , function ( done ) {
122
122
const e = new Error ( ) ;
123
123
onUnhandledSucceed ( done , function ( reason , promise ) {
124
- assert . strictEqual ( e , reason ) ;
124
+ assert . strictEqual ( reason , e ) ;
125
125
} ) ;
126
126
new Promise ( function ( _ , reject ) {
127
127
reject ( e ) ;
@@ -132,7 +132,7 @@ asyncTest('Promise rejected after setImmediate should trigger' +
132
132
' unhandledRejection' , function ( done ) {
133
133
const e = new Error ( ) ;
134
134
onUnhandledSucceed ( done , function ( reason , promise ) {
135
- assert . strictEqual ( e , reason ) ;
135
+ assert . strictEqual ( reason , e ) ;
136
136
} ) ;
137
137
new Promise ( function ( _ , reject ) {
138
138
setImmediate ( function ( ) {
@@ -145,7 +145,7 @@ asyncTest('Promise rejected after setTimeout(,1) should trigger' +
145
145
' unhandled rejection' , function ( done ) {
146
146
const e = new Error ( ) ;
147
147
onUnhandledSucceed ( done , function ( reason , promise ) {
148
- assert . strictEqual ( e , reason ) ;
148
+ assert . strictEqual ( reason , e ) ;
149
149
} ) ;
150
150
new Promise ( function ( _ , reject ) {
151
151
setTimeout ( function ( ) {
@@ -158,7 +158,7 @@ asyncTest('Catching a promise rejection after setImmediate is not' +
158
158
' soon enough to stop unhandledRejection' , function ( done ) {
159
159
const e = new Error ( ) ;
160
160
onUnhandledSucceed ( done , function ( reason , promise ) {
161
- assert . strictEqual ( e , reason ) ;
161
+ assert . strictEqual ( reason , e ) ;
162
162
} ) ;
163
163
let _reject ;
164
164
const promise = new Promise ( function ( _ , reject ) {
@@ -175,11 +175,11 @@ asyncTest('When re-throwing new errors in a promise catch, only the' +
175
175
const e = new Error ( ) ;
176
176
const e2 = new Error ( ) ;
177
177
onUnhandledSucceed ( done , function ( reason , promise ) {
178
- assert . strictEqual ( e2 , reason ) ;
179
- assert . strictEqual ( promise2 , promise ) ;
178
+ assert . strictEqual ( reason , e2 ) ;
179
+ assert . strictEqual ( promise , promise2 ) ;
180
180
} ) ;
181
181
const promise2 = Promise . reject ( e ) . then ( assert . fail , function ( reason ) {
182
- assert . strictEqual ( e , reason ) ;
182
+ assert . strictEqual ( reason , e ) ;
183
183
throw e2 ;
184
184
} ) ;
185
185
} ) ;
@@ -188,7 +188,7 @@ asyncTest('Test params of unhandledRejection for a synchronously-rejected ' +
188
188
'promise' , function ( done ) {
189
189
const e = new Error ( ) ;
190
190
onUnhandledSucceed ( done , function ( reason , promise ) {
191
- assert . strictEqual ( e , reason ) ;
191
+ assert . strictEqual ( reason , e ) ;
192
192
assert . strictEqual ( promise , promise ) ;
193
193
} ) ;
194
194
Promise . reject ( e ) ;
@@ -200,15 +200,15 @@ asyncTest('When re-throwing new errors in a promise catch, only the ' +
200
200
const e = new Error ( ) ;
201
201
const e2 = new Error ( ) ;
202
202
onUnhandledSucceed ( done , function ( reason , promise ) {
203
- assert . strictEqual ( e2 , reason ) ;
204
- assert . strictEqual ( promise2 , promise ) ;
203
+ assert . strictEqual ( reason , e2 ) ;
204
+ assert . strictEqual ( promise , promise2 ) ;
205
205
} ) ;
206
206
const promise2 = new Promise ( function ( _ , reject ) {
207
207
setTimeout ( function ( ) {
208
208
reject ( e ) ;
209
209
} , 1 ) ;
210
210
} ) . then ( assert . fail , function ( reason ) {
211
- assert . strictEqual ( e , reason ) ;
211
+ assert . strictEqual ( reason , e ) ;
212
212
throw e2 ;
213
213
} ) ;
214
214
} ) ;
@@ -219,15 +219,15 @@ asyncTest('When re-throwing new errors in a promise catch, only the re-thrown' +
219
219
const e = new Error ( ) ;
220
220
const e2 = new Error ( ) ;
221
221
onUnhandledSucceed ( done , function ( reason , promise ) {
222
- assert . strictEqual ( e2 , reason ) ;
223
- assert . strictEqual ( promise2 , promise ) ;
222
+ assert . strictEqual ( reason , e2 ) ;
223
+ assert . strictEqual ( promise , promise2 ) ;
224
224
} ) ;
225
225
const promise = new Promise ( function ( _ , reject ) {
226
226
setTimeout ( function ( ) {
227
227
reject ( e ) ;
228
228
process . nextTick ( function ( ) {
229
229
promise2 = promise . then ( assert . fail , function ( reason ) {
230
- assert . strictEqual ( e , reason ) ;
230
+ assert . strictEqual ( reason , e ) ;
231
231
throw e2 ;
232
232
} ) ;
233
233
} ) ;
@@ -308,7 +308,7 @@ asyncTest('catching a promise which is asynchronously rejected (via ' +
308
308
} , 1 ) ;
309
309
} ) ;
310
310
} ) . then ( assert . fail , function ( reason ) {
311
- assert . strictEqual ( e , reason ) ;
311
+ assert . strictEqual ( reason , e ) ;
312
312
} ) ;
313
313
} ) ;
314
314
@@ -319,7 +319,7 @@ asyncTest('Catching a rejected promise derived from throwing in a' +
319
319
Promise . resolve ( ) . then ( function ( ) {
320
320
throw e ;
321
321
} ) . then ( assert . fail , function ( reason ) {
322
- assert . strictEqual ( e , reason ) ;
322
+ assert . strictEqual ( reason , e ) ;
323
323
} ) ;
324
324
} ) ;
325
325
@@ -331,7 +331,7 @@ asyncTest('Catching a rejected promise derived from returning a' +
331
331
Promise . resolve ( ) . then ( function ( ) {
332
332
return Promise . reject ( e ) ;
333
333
} ) . then ( assert . fail , function ( reason ) {
334
- assert . strictEqual ( e , reason ) ;
334
+ assert . strictEqual ( reason , e ) ;
335
335
} ) ;
336
336
} ) ;
337
337
@@ -340,8 +340,8 @@ asyncTest('A rejected promise derived from returning an' +
340
340
' does trigger unhandledRejection' , function ( done ) {
341
341
const e = new Error ( ) ;
342
342
onUnhandledSucceed ( done , function ( reason , promise ) {
343
- assert . strictEqual ( e , reason ) ;
344
- assert . strictEqual ( _promise , promise ) ;
343
+ assert . strictEqual ( reason , e ) ;
344
+ assert . strictEqual ( promise , _promise ) ;
345
345
} ) ;
346
346
const _promise = Promise . resolve ( ) . then ( function ( ) {
347
347
return new Promise ( function ( _ , reject ) {
@@ -356,8 +356,8 @@ asyncTest('A rejected promise derived from throwing in a fulfillment handler' +
356
356
' does trigger unhandledRejection' , function ( done ) {
357
357
const e = new Error ( ) ;
358
358
onUnhandledSucceed ( done , function ( reason , promise ) {
359
- assert . strictEqual ( e , reason ) ;
360
- assert . strictEqual ( _promise , promise ) ;
359
+ assert . strictEqual ( reason , e ) ;
360
+ assert . strictEqual ( promise , _promise ) ;
361
361
} ) ;
362
362
const _promise = Promise . resolve ( ) . then ( function ( ) {
363
363
throw e ;
@@ -370,8 +370,8 @@ asyncTest(
370
370
function ( done ) {
371
371
const e = new Error ( ) ;
372
372
onUnhandledSucceed ( done , function ( reason , promise ) {
373
- assert . strictEqual ( e , reason ) ;
374
- assert . strictEqual ( _promise , promise ) ;
373
+ assert . strictEqual ( reason , e ) ;
374
+ assert . strictEqual ( promise , _promise ) ;
375
375
} ) ;
376
376
const _promise = Promise . resolve ( ) . then ( function ( ) {
377
377
return Promise . reject ( e ) ;
@@ -410,8 +410,8 @@ asyncTest('Failing to catch the Promise.all() of a collection that includes' +
410
410
' promise, not the passed promise' , function ( done ) {
411
411
const e = new Error ( ) ;
412
412
onUnhandledSucceed ( done , function ( reason , promise ) {
413
- assert . strictEqual ( e , reason ) ;
414
- assert . strictEqual ( p , promise ) ;
413
+ assert . strictEqual ( reason , e ) ;
414
+ assert . strictEqual ( promise , p ) ;
415
415
} ) ;
416
416
const p = Promise . all ( [ Promise . reject ( e ) ] ) ;
417
417
} ) ;
@@ -422,13 +422,13 @@ asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' +
422
422
const unhandledPromises = [ ] ;
423
423
const e = new Error ( ) ;
424
424
process . on ( 'unhandledRejection' , function ( reason , promise ) {
425
- assert . strictEqual ( e , reason ) ;
425
+ assert . strictEqual ( reason , e ) ;
426
426
unhandledPromises . push ( promise ) ;
427
427
} ) ;
428
428
process . on ( 'rejectionHandled' , function ( promise ) {
429
- assert . strictEqual ( 1 , unhandledPromises . length ) ;
429
+ assert . strictEqual ( unhandledPromises . length , 1 ) ;
430
430
assert . strictEqual ( unhandledPromises [ 0 ] , promise ) ;
431
- assert . strictEqual ( thePromise , promise ) ;
431
+ assert . strictEqual ( promise , thePromise ) ;
432
432
done ( ) ;
433
433
} ) ;
434
434
@@ -437,7 +437,7 @@ asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' +
437
437
} ) ;
438
438
setTimeout ( function ( ) {
439
439
thePromise . then ( assert . fail , function ( reason ) {
440
- assert . strictEqual ( e , reason ) ;
440
+ assert . strictEqual ( reason , e ) ;
441
441
} ) ;
442
442
} , 10 ) ;
443
443
} ) ;
@@ -568,8 +568,8 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
568
568
' (setImmediate before promise creation/rejection)' , function ( done ) {
569
569
const e = new Error ( ) ;
570
570
onUnhandledSucceed ( done , function ( reason , promise ) {
571
- assert . strictEqual ( e , reason ) ;
572
- assert . strictEqual ( p , promise ) ;
571
+ assert . strictEqual ( reason , e ) ;
572
+ assert . strictEqual ( promise , p ) ;
573
573
} ) ;
574
574
const p = Promise . reject ( e ) ;
575
575
setImmediate ( function ( ) {
@@ -583,8 +583,8 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
583
583
' handler; unhandledRejection will be triggered in that case' +
584
584
' (setImmediate before promise creation/rejection)' , function ( done ) {
585
585
onUnhandledSucceed ( done , function ( reason , promise ) {
586
- assert . strictEqual ( undefined , reason ) ;
587
- assert . strictEqual ( p , promise ) ;
586
+ assert . strictEqual ( reason , undefined ) ;
587
+ assert . strictEqual ( promise , p ) ;
588
588
} ) ;
589
589
setImmediate ( function ( ) {
590
590
Promise . resolve ( ) . then ( function ( ) {
@@ -604,8 +604,8 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
604
604
' handler; unhandledRejection will be triggered in that case' +
605
605
' (setImmediate after promise creation/rejection)' , function ( done ) {
606
606
onUnhandledSucceed ( done , function ( reason , promise ) {
607
- assert . strictEqual ( undefined , reason ) ;
608
- assert . strictEqual ( p , promise ) ;
607
+ assert . strictEqual ( reason , undefined ) ;
608
+ assert . strictEqual ( promise , p ) ;
609
609
} ) ;
610
610
const p = Promise . reject ( ) ;
611
611
setImmediate ( function ( ) {
@@ -634,8 +634,8 @@ asyncTest(
634
634
const e = new Error ( 'error' ) ;
635
635
const domainError = new Error ( 'domain error' ) ;
636
636
onUnhandledSucceed ( done , function ( reason , promise ) {
637
- assert . strictEqual ( reason , e ) ;
638
- assert . strictEqual ( domainReceivedError , domainError ) ;
637
+ assert . strictEqual ( e , reason ) ;
638
+ assert . strictEqual ( domainError , domainReceivedError ) ;
639
639
} ) ;
640
640
Promise . reject ( e ) ;
641
641
process . nextTick ( function ( ) {
@@ -670,7 +670,7 @@ asyncTest('Throwing an error inside a rejectionHandled handler goes to' +
670
670
const e = new Error ( ) ;
671
671
const e2 = new Error ( ) ;
672
672
const tearDownException = setupException ( function ( err ) {
673
- assert . strictEqual ( e2 , err ) ;
673
+ assert . strictEqual ( err , e2 ) ;
674
674
tearDownException ( ) ;
675
675
done ( ) ;
676
676
} ) ;
0 commit comments