jeffrifwald / babel-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
144 stars 23 forks source link

change the source map bias to LEAST_UPPER_BOUND #15

Closed Swatinem closed 9 years ago

Swatinem commented 9 years ago

This fixes reporting of destructuring assignments for me. Before their statements were ignored, because the 'start' loc had no match. Now statement and line are correctly reported, although the column might be a bit off: bildschirmfoto vom 2015-06-22 03-12-30 But its better than nothing

Swatinem commented 9 years ago

Hm, just some observations I made when running my own code through this:

The mapped locations for arrow functions are a lot nicer, and now even the expression inside the arrow function is correctly mapped, which is great: bildschirmfoto vom 2015-06-22 20-10-38

Import and export statements (declarations) are now correctly mapped and reported.

BUT it also maps the return statement inside of re-exports (not the functions themselves though) so if you do not actually use those re-exports, they are reported as uncovered statements :-(

But I think the other improvements are worth it…