Lines Matching refs:promise
87 process.on('unhandledRejection', function(reason, promise) {
89 predicate(reason, promise);
99 process.on('unhandledRejection', function(reason, promise) {
110 asyncTest('synchronously rejected promise should trigger' +
113 onUnhandledSucceed(done, function(reason, promise) {
119 asyncTest('synchronously rejected promise should trigger' +
122 onUnhandledSucceed(done, function(reason, promise) {
133 onUnhandledSucceed(done, function(reason, promise) {
146 onUnhandledSucceed(done, function(reason, promise) {
156 asyncTest('Catching a promise rejection after setImmediate is not' +
159 onUnhandledSucceed(done, function(reason, promise) {
163 const promise = new Promise(function(_, reject) {
168 promise.then(assert.fail, function() {});
172 asyncTest('When re-throwing new errors in a promise catch, only the' +
176 onUnhandledSucceed(done, function(reason, promise) {
178 assert.strictEqual(promise, promise2);
187 'promise', function(done) {
189 onUnhandledSucceed(done, function(reason, promise) {
191 assert.strictEqual(promise, promise);
196 asyncTest('When re-throwing new errors in a promise catch, only the ' +
197 're-thrown error should hit unhandledRejection: original promise' +
201 onUnhandledSucceed(done, function(reason, promise) {
203 assert.strictEqual(promise, promise2);
215 asyncTest('When re-throwing new errors in a promise catch, only the re-thrown' +
216 ' error should hit unhandledRejection: promise catch attached a' +
220 onUnhandledSucceed(done, function(reason, promise) {
222 assert.strictEqual(promise, promise2);
224 const promise = new Promise(function(_, reject) {
228 promise2 = promise.then(assert.fail, function(reason) {
239 'unhandledRejection should not be triggered if a promise catch is' +
240 ' attached synchronously upon the promise\'s creation',
249 'unhandledRejection should not be triggered if a promise catch is' +
250 ' attached synchronously upon the promise\'s creation',
260 asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' +
264 const promise = Promise.reject(e);
266 promise.then(assert.fail, function() {});
270 asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' +
274 const promise = new Promise(function(_, reject) {
278 promise.then(assert.fail, function() {});
282 asyncTest('While inside setImmediate, catching a rejected promise derived ' +
283 'from returning a rejected promise in a fulfillment handler ' +
298 asyncTest('catching a promise which is asynchronously rejected (via ' +
299 'resolution to an asynchronously-rejected promise) prevents' +
314 asyncTest('Catching a rejected promise derived from throwing in a' +
325 asyncTest('Catching a rejected promise derived from returning a' +
326 ' synchronously-rejected promise in a fulfillment handler' +
337 asyncTest('A rejected promise derived from returning an' +
338 ' asynchronously-rejected promise in a fulfillment handler' +
341 onUnhandledSucceed(done, function(reason, promise) {
343 assert.strictEqual(promise, _promise);
354 asyncTest('A rejected promise derived from throwing in a fulfillment handler' +
357 onUnhandledSucceed(done, function(reason, promise) {
359 assert.strictEqual(promise, _promise);
367 'A rejected promise derived from returning a synchronously-rejected' +
368 ' promise in a fulfillment handler does trigger unhandledRejection',
371 onUnhandledSucceed(done, function(reason, promise) {
373 assert.strictEqual(promise, _promise);
383 'rejected promise prevents unhandledRejection', function(done) {
391 'nextTick-async rejected promise prevents unhandledRejection',
408 ' a rejected promise triggers unhandledRejection for the returned' +
409 ' promise, not the passed promise', function(done) {
411 onUnhandledSucceed(done, function(reason, promise) {
413 assert.strictEqual(promise, p);
418 asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' +
423 process.on('unhandledRejection', function(reason, promise) {
425 unhandledPromises.push(promise);
427 process.on('rejectionHandled', function(promise) {
429 assert.strictEqual(unhandledPromises[0], promise);
430 assert.strictEqual(promise, thePromise);
444 asyncTest('Waiting for some combination of process.nextTick + promise' +
463 asyncTest('Waiting for some combination of process.nextTick + promise' +
483 asyncTest('Waiting for some combination of process.nextTick + promise ' +
503 asyncTest('Waiting for some combination of promise microtasks + ' +
523 'Waiting for some combination of promise microtasks +' +
545 asyncTest('Waiting for some combination of promise microtasks +' +
565 asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
567 ' (setImmediate before promise creation/rejection)', function(done) {
569 onUnhandledSucceed(done, function(reason, promise) {
571 assert.strictEqual(promise, p);
581 asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
583 ' (setImmediate before promise creation/rejection)', function(done) {
584 onUnhandledSucceed(done, function(reason, promise) {
586 assert.strictEqual(promise, p);
602 asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
604 ' (setImmediate after promise creation/rejection)', function(done) {
605 onUnhandledSucceed(done, function(reason, promise) {
607 assert.strictEqual(promise, p);
627 process.on('unhandledRejection', function(reason, promise) {
665 asyncTest('Rejected promise inside unhandledRejection allows nextTick loop' +
673 const promise = Promise.reject(0);
674 process.nextTick(() => promise.catch(() => done()));
697 'Catching a promise should not take effect on previous promises',
699 onUnhandledSucceed(done, function(reason, promise) {