How do you use Istanbul Code Coverage with transpiled Typescript?

后端 未结 5 1059
耶瑟儿~
耶瑟儿~ 2021-02-01 14:11

I\'ve been reading articles on this all morning trying to get my environment setup correctly. But for some reason I\'m not getting it. My setup-

/app
    ... sou         


        
5条回答
  •  独厮守ぢ
    2021-02-01 14:46

    If you want source map support with Istanbul, you can use the 1.0 alpha release as the current release does not support source maps. I have it set up using ts-node in http://github.com/typings/typings (see https://github.com/typings/typings/blob/bff1abad91dabec1cd8a744e0dd3f54b613830b5/package.json#L19) and source code is being mapped. It looks great and is nice to have my tests and code coverage all running in-process with zero transpilation. Of course, you can use Istanbul 1.0 with the transpiled JavaScript.

    For the browser implementation you're using, I'd have to see more of code of what you're doing to see this'll just work for you, but try the 1.0.0-alpha.2 and see what happens.

提交回复
热议问题