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

Unable to lookup source #837

Closed
golonikum opened this issue May 11, 2018 · 3 comments
Closed

Unable to lookup source #837

golonikum opened this issue May 11, 2018 · 3 comments

Comments

@golonikum
Copy link
Contributor

golonikum commented May 11, 2018

Expected Behavior

Content of the source files must be in the coverage report.

Observed Behavior

All report files contain the same excepion log:
Unable to lookup source: ...(ENOENT: no such file or directory, open '...')

Bonus Points! Code (or Repository) that Reproduces Issue

https://github.com/golonikum/testNycIssue

npm install
npm run testWithCoverage

Open coverage/index.html and click on source.js link.

Forensic Information

Operating System: Microsoft Windows 10 Enterprise.
Environment Information: https://gist.github.com/golonikum/70385ce51a8bfe1b91947058d9f39197

@golonikum
Copy link
Contributor Author

golonikum commented Jul 26, 2018

Such local fix can help: in method NYC.prototype.instrumentAllFiles replace

if (transform) {
    code = transform(code, {filename: filename, relFile: inFile})
}

with

if (transform) {
    code = transform(code, {filename: path.resolve(inputDir, filename), relFile: inFile})
}  

@stale stale bot added the wontfix label Jan 5, 2019
@stale stale bot added the stale label Mar 6, 2019
@istanbuljs istanbuljs deleted a comment from stale bot Mar 7, 2019
@stale stale bot removed the stale label Mar 7, 2019
@istanbuljs istanbuljs deleted a comment from stale bot Mar 7, 2019
@JaKXz
Copy link
Member

JaKXz commented Mar 7, 2019

Hi @golonikum sorry for the late reply! Would you like to submit a PR with your change? otherwise I will try to make some time for it but we welcome contributions :) It would be interesting to see if we can reproduce this in a failing test

golonikum pushed a commit to golonikum/nyc that referenced this issue Mar 7, 2019
golonikum pushed a commit to golonikum/nyc that referenced this issue Mar 7, 2019
@coreyfarrell
Copy link
Member

@golonikum I've merged your fix, thank you.

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