Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions integration-tests/__tests__/__snapshots__/failures.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,15 @@ exports[`not throwing Error objects 5`] = `
],
}

33 | });
34 |
> 35 | test('done(non-error)', done => {
| ^
36 | done(deepObject);
35 | test('done(non-error)', done => {
> 36 | done(deepObject);
| ^
37 | });
38 |


at packages/jest-jasmine2/build/jasmine/Spec.js:79:20
at __tests__/during_tests.test.js:35:1
at packages/jest-jasmine2/build/expectation_result_factory.js:62:10
at __tests__/during_tests.test.js:36:3

"
`;
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-jasmine2/src/expectation_result_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function stackFormatter(options, initError, errorMessage) {
return options.error.stack;
}

if (initError) {
if (!options.fromFail && initError) {
return errorMessage + '\n' + initError.stack;
}

Expand All @@ -50,6 +50,7 @@ function stackFormatter(options, initError, errorMessage) {
type Options = {
matcherName: string,
passed: boolean,
fromFail?: boolean,
actual?: any,
error?: any,
expected?: any,
Expand Down
1 change: 1 addition & 0 deletions packages/jest-jasmine2/src/jasmine/Env.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export default function(j$) {
expected: '',
actual: '',
message,
fromFail: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really happy with this one... Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, got a better one, pushing

error: isError ? error : null,
});
};
Expand Down