Skip to content

Conversation

@vadimdemedes
Copy link
Contributor

This PR fixes #271. Now AVA shows full stack trace for non-assertion errors. Before, it wrapped them in assert.AssertionError, which swallowed the original stack.

@sindresorhus
Copy link
Member

It's pretty unclear what kind of error it is now, though:

var test = require('./');

test('wow', async t => {
    throw new Error('unicorn');
});
✖ wow unicorn

  1 test failed

  1. wow
  Error: unicorn
    at _callee$ (/Users/sindresorhus/dev/ava/example.js:4:8)
...

It just logs unicorn where you usually have true === false, etc.

We should somehow make it clear something in the test threw/rejected.

@vadimdemedes
Copy link
Contributor Author

How about:

✖ wow failed with "unicorn"

@sindresorhus
Copy link
Member

👍

@vadimdemedes
Copy link
Contributor Author

Updated output:

screen shot 2015-12-25 at 2 14 34 pm

@sindresorhus
Copy link
Member

LGTM

sindresorhus added a commit that referenced this pull request Dec 26, 2015
Show full stack trace for non-assert errors
@sindresorhus sindresorhus merged commit 945dbea into master Dec 26, 2015
@sindresorhus sindresorhus deleted the fix-error-stacks branch December 26, 2015 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better runtime errors

3 participants