Skip to content

Commit

Permalink
trim when adding custom stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 20, 2018
1 parent 7ed2886 commit 21fd945
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`not throwing Error objects 2`] = `
● Test suite failed to run
Error
banana
"
Expand Down Expand Up @@ -142,7 +143,6 @@ exports[`not throwing Error objects 5`] = `
9 | });
10 |
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
at __tests__/during_tests.test.js:7:1
Expand All @@ -158,7 +158,6 @@ exports[`not throwing Error objects 5`] = `
13 | throw false;
14 | });
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
at __tests__/during_tests.test.js:11:1
Expand All @@ -174,7 +173,6 @@ exports[`not throwing Error objects 5`] = `
18 | throw undefined;
19 | });
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
at __tests__/during_tests.test.js:16:1
Expand All @@ -197,7 +195,6 @@ exports[`not throwing Error objects 5`] = `
23 | throw deepObject;
24 | });
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
at __tests__/during_tests.test.js:21:1
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/src/expectation_result_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function stackFormatter(options, initError, errorMessage) {
}

if (initError) {
return errorMessage + '\n' + initError.stack;
return errorMessage.trimRight() + '\n\n' + initError.stack;
}

return new Error(errorMessage).stack;
Expand Down

0 comments on commit 21fd945

Please sign in to comment.