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

Incorrect Line numbers for script errors #1323

Closed
1 task done
andinoJamesV opened this issue May 29, 2020 · 1 comment
Closed
1 task done

Incorrect Line numbers for script errors #1323

andinoJamesV opened this issue May 29, 2020 · 1 comment

Comments

@andinoJamesV
Copy link

andinoJamesV commented May 29, 2020

Link to bug demonstration repository

Expected Behavior

Running the command
../node_modules/.bin/nyc --cache false --source-map ../node_modules/.bin/mocha Test/Spork.js
Should produce coverage with correct file and error line numbers

note attempted to use inline and linked source maps

Observed Behavior

Running the command

../node_modules/.bin/nyc ../node_modules/.bin/mocha Test/Spork.js
Produces no coverage if source map urls are present in tested files

If no source map urls are present in tested files
../node_modules/.bin/nyc ../node_modules/.bin/mocha Test/Spork.js
then coverage is as expected but error lines are incorrect

If running the command
../node_modules/.bin/nyc --source-map ../node_modules/.bin/mocha Test/Spork.js
then no coverage is produced and line numbers are still incorrect

Running the command
../node_modules/.bin/mocha Test/Spork.js
produces the expected results showing the correct file and line number for the error

Troubleshooting steps

  • still occurring when I put cache: false in my nyc config

Environment Information

 System:
    OS: Linux 4.19 Raspbian GNU/Linux 10 (buster) 10 (buster)
    CPU: (4) arm ARMv7 Processor rev 3 (v7l)
    Memory: 212.20 MB / 1.89 GB
  Binaries:
    Node: 12.17.0 - ~/.bin/node-v12.17.0-linux-armv7l/bin/node
    npm: 6.14.4 - ~/.bin/node-v12.17.0-linux-armv7l/bin/npm
  npmPackages:
    nyc: ^15.0.1 => 15.0.1 

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

No branches or pull requests

1 participant