gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Convert relative file names to be absolute #759

Open jamime opened 7 years ago

jamime commented 7 years ago

I have a dojo project that is being tested using node C:\Users\js\dojo\dojo.js load=C:\Users\js\test.js (It's a bit more complex but the use case is the same.

However my coverage report is produced with absolute file names (C:\Users\js\dojo\dojo.js) I want to be able to set the file names to be relative to C:\Users\js\ so my file names would be dojo\dojo.js.

I can achieve this by changing cwd to C:\Users\js then running node dojo\dojo.js load=test.js .

This works fine, however when I --include-all-sources all of those files have an absolute file name. Can I change the format of the file names used in cover all sources?

jamime commented 7 years ago

I think --include-all-sources should report files as relative paths from --root