Closed iamolivinius closed 6 years ago
Not sure if this is the right place to file this issue but your project seems to me to be a common denominator.
My goal is to get code coverage reports of a typescript project. Therefore I use the karma test runner in the following configuration.
var istanbul = require('browserify-istanbul'); module.exports = function(config) { config.set({ basePath: '', frameworks: ['browserify', 'mocha', 'chai', 'source-map-support'], files: [ 'test/**/*Spec.ts' ], exclude: [ ], preprocessors: { 'test/**/*Spec.ts': ['browserify'] }, browserify: { debug: true, transform: [istanbul()] }, reporters: ['progress', 'coverage'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: true, concurrency: Infinity }) }
export function add(a: number, b: number): number { if (a === 0) return b if (b === 0) return a return a + b }
import {add} from '../src/add' const expect = chai.expect describe('test add module', () => { it('should add 2 numbers', () => { expect(add(1, 2)).to.be.equal(3) }) })
The metrics of the coverage report seem to be ok but the annotation in the "source file view" are a bit odd.
My first guess is that something with the source maps went wrong due to the multiple transformations along the process.
I hope you can provide me any information or point me in the right direction to solve this issue.
Also I filed this as a question on stackoverflow earlier today: http://stackoverflow.com/questions/38764929/how-to-do-code-coverage-with-karma-typescript-and-browserify
Closing this as WONT_FIX as this is I don't have sufficient knowledge on tsify + coverage setups to help you out on this one.
WONT_FIX
tsify
Not sure if this is the right place to file this issue but your project seems to me to be a common denominator.
My goal is to get code coverage reports of a typescript project. Therefore I use the karma test runner in the following configuration.
src/add.ts
test/addSpec.ts
The metrics of the coverage report seem to be ok but the annotation in the "source file view" are a bit odd.
My first guess is that something with the source maps went wrong due to the multiple transformations along the process.
I hope you can provide me any information or point me in the right direction to solve this issue.
Also I filed this as a question on stackoverflow earlier today: http://stackoverflow.com/questions/38764929/how-to-do-code-coverage-with-karma-typescript-and-browserify