summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-02 14:08:01 +0100
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2018-12-11 15:18:30 +0000
commit62fb5dbec557745f9f828d728ca25f327ca5300c (patch)
treecdc68c3114f689c15fcab87d8e73abc4259ab6fa
parent74c1074d53046138947e546462b21c1f216d81c7 (diff)
downloadnode-new-62fb5dbec557745f9f828d728ca25f327ca5300c.tar.gz
assert: revert breaking change
It was not intended to change the `assert.doesNotThrow()` message with https://github.com/nodejs/node/pull/23223. This reverts the breaking behavior to the one before. PR-URL: https://github.com/nodejs/node/pull/24786 Refs: https://github.com/nodejs/node/pull/23223 Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
-rw-r--r--lib/assert.js2
-rw-r--r--test/parallel/test-assert-async.js2
-rw-r--r--test/parallel/test-assert.js2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/assert.js b/lib/assert.js
index 594a5acfbd..e29a381acb 100644
--- a/lib/assert.js
+++ b/lib/assert.js
@@ -782,7 +782,7 @@ function expectsNoError(stackStartFn, actual, error, message) {
actual,
expected: error,
operator: stackStartFn.name,
- message: `Got unwanted ${fnType}${details}\n${actual.message}`,
+ message: `Got unwanted ${fnType}${details}`,
stackStartFn
});
}
diff --git a/test/parallel/test-assert-async.js b/test/parallel/test-assert-async.js
index c397a4db08..237df0bb66 100644
--- a/test/parallel/test-assert-async.js
+++ b/test/parallel/test-assert-async.js
@@ -34,7 +34,7 @@ common.crashOnUnhandledRejection();
assert(err instanceof assert.AssertionError,
`${err.name} is not instance of AssertionError`);
assert.strictEqual(err.code, 'ERR_ASSERTION');
- assert(/^Got unwanted rejection\.\n$/.test(err.message));
+ assert(/^Got unwanted rejection\.$/.test(err.message));
assert.strictEqual(err.operator, 'doesNotReject');
assert.ok(!err.stack.includes('at Function.doesNotReject'));
return true;
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index 7335982a6c..acedd9ed4f 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -460,7 +460,7 @@ common.expectsError(
type: a.AssertionError,
code: 'ERR_ASSERTION',
operator: 'doesNotThrow',
- message: 'Got unwanted exception: user message\n[object Object]'
+ message: 'Got unwanted exception: user message'
}
);