Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDusan Radovanovic <dushanr@gmail.com>2018-10-12 21:28:00 +0300
committerMyles Borins <mylesborins@google.com>2018-11-29 19:39:00 +0300
commitd61901499ae650290f3dad63e83306af52de4e0b (patch)
tree2cd2901aad588684589a9152794bd00908352d16 /test
parent806242bf403fc1fa9d026b9246ea52f33484efdc (diff)
test: reversed params in assert.strictEqual()
Reversed parameters of assert.strictEqual() in test-promises-unhandled-rejections.js so that first one is actual and second one is expected value. PR-URL: https://github.com/nodejs/node/pull/23591 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-promises-unhandled-rejections.js78
1 files changed, 39 insertions, 39 deletions
diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js
index 92b6d7a9614..d336630f7cf 100644
--- a/test/parallel/test-promises-unhandled-rejections.js
+++ b/test/parallel/test-promises-unhandled-rejections.js
@@ -112,7 +112,7 @@ asyncTest('synchronously rejected promise should trigger' +
' unhandledRejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
Promise.reject(e);
});
@@ -121,7 +121,7 @@ asyncTest('synchronously rejected promise should trigger' +
' unhandledRejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
new Promise(function(_, reject) {
reject(e);
@@ -132,7 +132,7 @@ asyncTest('Promise rejected after setImmediate should trigger' +
' unhandledRejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
new Promise(function(_, reject) {
setImmediate(function() {
@@ -145,7 +145,7 @@ asyncTest('Promise rejected after setTimeout(,1) should trigger' +
' unhandled rejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
new Promise(function(_, reject) {
setTimeout(function() {
@@ -158,7 +158,7 @@ asyncTest('Catching a promise rejection after setImmediate is not' +
' soon enough to stop unhandledRejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
let _reject;
const promise = new Promise(function(_, reject) {
@@ -175,11 +175,11 @@ asyncTest('When re-throwing new errors in a promise catch, only the' +
const e = new Error();
const e2 = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e2, reason);
- assert.strictEqual(promise2, promise);
+ assert.strictEqual(reason, e2);
+ assert.strictEqual(promise, promise2);
});
const promise2 = Promise.reject(e).then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
throw e2;
});
});
@@ -188,7 +188,7 @@ asyncTest('Test params of unhandledRejection for a synchronously-rejected ' +
'promise', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
assert.strictEqual(promise, promise);
});
Promise.reject(e);
@@ -200,15 +200,15 @@ asyncTest('When re-throwing new errors in a promise catch, only the ' +
const e = new Error();
const e2 = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e2, reason);
- assert.strictEqual(promise2, promise);
+ assert.strictEqual(reason, e2);
+ assert.strictEqual(promise, promise2);
});
const promise2 = new Promise(function(_, reject) {
setTimeout(function() {
reject(e);
}, 1);
}).then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
throw e2;
});
});
@@ -219,15 +219,15 @@ asyncTest('When re-throwing new errors in a promise catch, only the re-thrown' +
const e = new Error();
const e2 = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e2, reason);
- assert.strictEqual(promise2, promise);
+ assert.strictEqual(reason, e2);
+ assert.strictEqual(promise, promise2);
});
const promise = new Promise(function(_, reject) {
setTimeout(function() {
reject(e);
process.nextTick(function() {
promise2 = promise.then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
throw e2;
});
});
@@ -308,7 +308,7 @@ asyncTest('catching a promise which is asynchronously rejected (via ' +
}, 1);
});
}).then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
});
@@ -319,7 +319,7 @@ asyncTest('Catching a rejected promise derived from throwing in a' +
Promise.resolve().then(function() {
throw e;
}).then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
});
@@ -331,7 +331,7 @@ asyncTest('Catching a rejected promise derived from returning a' +
Promise.resolve().then(function() {
return Promise.reject(e);
}).then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
});
@@ -340,8 +340,8 @@ asyncTest('A rejected promise derived from returning an' +
' does trigger unhandledRejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
- assert.strictEqual(_promise, promise);
+ assert.strictEqual(reason, e);
+ assert.strictEqual(promise, _promise);
});
const _promise = Promise.resolve().then(function() {
return new Promise(function(_, reject) {
@@ -356,8 +356,8 @@ asyncTest('A rejected promise derived from throwing in a fulfillment handler' +
' does trigger unhandledRejection', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
- assert.strictEqual(_promise, promise);
+ assert.strictEqual(reason, e);
+ assert.strictEqual(promise, _promise);
});
const _promise = Promise.resolve().then(function() {
throw e;
@@ -370,8 +370,8 @@ asyncTest(
function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
- assert.strictEqual(_promise, promise);
+ assert.strictEqual(reason, e);
+ assert.strictEqual(promise, _promise);
});
const _promise = Promise.resolve().then(function() {
return Promise.reject(e);
@@ -410,8 +410,8 @@ asyncTest('Failing to catch the Promise.all() of a collection that includes' +
' promise, not the passed promise', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
- assert.strictEqual(p, promise);
+ assert.strictEqual(reason, e);
+ assert.strictEqual(promise, p);
});
const p = Promise.all([Promise.reject(e)]);
});
@@ -422,13 +422,13 @@ asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' +
const unhandledPromises = [];
const e = new Error();
process.on('unhandledRejection', function(reason, promise) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
unhandledPromises.push(promise);
});
process.on('rejectionHandled', function(promise) {
- assert.strictEqual(1, unhandledPromises.length);
+ assert.strictEqual(unhandledPromises.length, 1);
assert.strictEqual(unhandledPromises[0], promise);
- assert.strictEqual(thePromise, promise);
+ assert.strictEqual(promise, thePromise);
done();
});
@@ -437,7 +437,7 @@ asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' +
});
setTimeout(function() {
thePromise.then(assert.fail, function(reason) {
- assert.strictEqual(e, reason);
+ assert.strictEqual(reason, e);
});
}, 10);
});
@@ -568,8 +568,8 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
' (setImmediate before promise creation/rejection)', function(done) {
const e = new Error();
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(e, reason);
- assert.strictEqual(p, promise);
+ assert.strictEqual(reason, e);
+ assert.strictEqual(promise, p);
});
const p = Promise.reject(e);
setImmediate(function() {
@@ -583,8 +583,8 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
' handler; unhandledRejection will be triggered in that case' +
' (setImmediate before promise creation/rejection)', function(done) {
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(undefined, reason);
- assert.strictEqual(p, promise);
+ assert.strictEqual(reason, undefined);
+ assert.strictEqual(promise, p);
});
setImmediate(function() {
Promise.resolve().then(function() {
@@ -604,8 +604,8 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' +
' handler; unhandledRejection will be triggered in that case' +
' (setImmediate after promise creation/rejection)', function(done) {
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(undefined, reason);
- assert.strictEqual(p, promise);
+ assert.strictEqual(reason, undefined);
+ assert.strictEqual(promise, p);
});
const p = Promise.reject();
setImmediate(function() {
@@ -634,8 +634,8 @@ asyncTest(
const e = new Error('error');
const domainError = new Error('domain error');
onUnhandledSucceed(done, function(reason, promise) {
- assert.strictEqual(reason, e);
- assert.strictEqual(domainReceivedError, domainError);
+ assert.strictEqual(e, reason);
+ assert.strictEqual(domainError, domainReceivedError);
});
Promise.reject(e);
process.nextTick(function() {
@@ -670,7 +670,7 @@ asyncTest('Throwing an error inside a rejectionHandled handler goes to' +
const e = new Error();
const e2 = new Error();
const tearDownException = setupException(function(err) {
- assert.strictEqual(e2, err);
+ assert.strictEqual(err, e2);
tearDownException();
done();
});