Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chaijs/chai-as-promised
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2b9185611d1e4e2db52c23d77d9f98c4e51a2e9b
Choose a base ref
..
head repository: chaijs/chai-as-promised
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bcfd8af97dc04617ddc8b507bd2a81604ad3db25
Choose a head ref
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/chai-as-promised.js
11 changes: 5 additions & 6 deletions lib/chai-as-promised.js
Original file line number Diff line number Diff line change
@@ -63,10 +63,9 @@ module.exports = (chai, utils) => {
try {
f();
} catch (e) {
if (originalError)
{
const message_lines = (originalError.message.match(/\n/g)||[]).length + 1;
e.stack = e.message + '\n' + originalError.stack.split('\n').slice(message_lines).join('\n');
if (originalError) {
const messageLines = (originalError.message.match(/\n/g) || []).length + 1;
e.stack = e.message + "\n" + originalError.stack.split("\n").slice(messageLines).join("\n");
}
throw e;
}
@@ -232,8 +231,8 @@ module.exports = (chai, utils) => {

if (errMsgMatcher) {
this.assert(errMsgMatcherCompatible,
`expected promise to be rejected with an error ${matcherRelation} #{exp} but got ` +
`#{act}`,
`expected promise to be rejected with an error ${matcherRelation} #{exp} ` +
`but got #{act}`,
`expected promise not to be rejected with an error ${matcherRelation} #{exp}`,
errMsgMatcher,
checkError.getMessage(reason));