You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test cases are loaded through babel require hook, and the require hook is registered with compiled version of the convert function(/lib/convert.js), which is instrumented by istanbul when loading.
The coverage map of compiled version is generated after running test cases, and transformed to coverage of original source(/src/*) by remap. This tool use source maps to find source locations of coverage hits, coverage locations are dropped if source locations can't be found.
Coverage: the modern way
Since the convert function becomes self-hosting(testing is self-hosted from the beginning), the instrumentation step can be done while code transformation, instead of instrumenting compiled code via istanbul require hook.
The testing still starts with registering babel require hook with compiled version of parse (and convert) function, with additional instrument plugin. The hook is used to (and only for) directly load the source(/src/*.ls) and apply instrumentation, and instrumented source is used to register babel require hook again, to load test cases.