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
constv8toIstanbul=require('v8-to-istanbul')// the path to the original source-file is required, as its contents are// used during the conversion algorithm.constconverter=v8toIstanbul('',undefined,{source:"function add(a:number,b:number){\n return a+b\n}\n\nconsole.log(add(1,2))"})// await converter.load() // this is required due to async file reading.// provide an array of coverage information in v8 format.converter.load().then(res=>{converter.applyCoverage([{"functionName": "","ranges": [{"startOffset": 0,"endOffset": 520,"count": 1}],"isBlockCoverage": true},// ...])// output coverage information in a form that can// be consumed by Istanbul.console.info(JSON.stringify(converter.toIstanbul()))})
The text was updated successfully, but these errors were encountered:
Why does the first parameter of v8-to-istanbul need to be a string, I see that you can just pass in sources.source.
https://github.com/istanbuljs/v8-to-istanbul/blob/master/lib/v8-to-istanbul.js#L48
The text was updated successfully, but these errors were encountered: