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

Test failures do not display accurate test line numbers in stack trace #2500

Closed
wesleycho opened this issue Dec 11, 2016 · 2 comments
Closed

Comments

@wesleycho
Copy link
Member

Expected behaviour

The line number in a test file referenced when a test fails is correct

Actual behaviour

The line number reported is incorrect, a virtual line number generated from Babel

Steps to reproduce the behaviour

  1. Go to
    expect(browser.fullName).to.equal(fullName)
  2. Change .to.equal(fullName) to .to.equal(fullName) + '1'
  3. Observe the line number reported

This likely is a simple configuration problem with Babel or one of the grunt plugins

@grifball
Copy link
Contributor

I tried to replicate this but couldn't. Your change didn't throw an error so I changed it to this:
.to.equal(fullName + '1')
And then it gave me the correct line number (30):
at Context.<anonymous> (test/unit/browser.spec.js:30:33)
I'm on the latest commit in the master branch, running npm test

@chriscasola
Copy link
Contributor

I was able to replicate this on os x with node v6.9.2 - it also incorrectly tells me the test failed on line 32 but the actual failure line is 30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants