Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stack traces on async failures #6008

Merged
merged 7 commits into from
Apr 17, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ exports[`works with async failures 1`] = `
14 |
15 | test('reject, but fail', () => {

at packages/expect/build/index.js:165:22
at __tests__/async_failures.test.js:12:57

● reject, but fail
Expand Down Expand Up @@ -254,7 +253,6 @@ exports[`works with async failures 1`] = `
18 |
19 | test('expect reject', () => {

at packages/expect/build/index.js:202:22
at __tests__/async_failures.test.js:16:55

● expect reject
Expand All @@ -272,7 +270,6 @@ exports[`works with async failures 1`] = `
22 |
23 | test('expect resolve', () => {

at packages/expect/build/index.js:96:15
at __tests__/async_failures.test.js:20:10

● expect resolve
Expand All @@ -290,7 +287,6 @@ exports[`works with async failures 1`] = `
26 |
27 | test('timeout', done => {

at packages/expect/build/index.js:96:15
at __tests__/async_failures.test.js:24:10

● timeout
Expand Down
7 changes: 6 additions & 1 deletion integration-tests/__tests__/failures.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ test('works with assertions in separate files', () => {
test('works with async failures', () => {
const {stderr} = runJest(dir, ['async_failures.test.js']);

expect(normalizeDots(extractSummary(stderr).rest)).toMatchSnapshot();
const rest = extractSummary(stderr)
Copy link
Member Author

Choose a reason for hiding this comment

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

node 6 is being difficult

.rest.split('\n')
.filter(line => line.indexOf('packages/expect/build/index.js') === -1)
.join('\n');

expect(normalizeDots(rest)).toMatchSnapshot();
});

test('works with snapshot failures', () => {
Expand Down