2
私はkarmaカバレッジで自分のタイプコピーソースファイルのカバレッジレポートを生成したいと思います。私の単体テストはjavascriptで書かれており、私はJasmine Testフレームワークを使用しています。Karma - typescriptカバレッジのソースマップを指す方法
マイフォルダ構造は次のようになります。
node_modules/
app/
app.js
app.js.map
app.ts
components/
controllers/
SampleController.ts
directives/
filters/
services/
unittests/
karma.conf.js
components/
controllers/
SampleControllerTest.js
directives/
filters/
services/
マイkarma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
plugins: [
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage',
'karma-phantomjs-launcher',
'karma-sourcemap-loader'
],
preprocessors: {
'../app/directives/controls/**/*Template.html' : [ 'ng-html2js' ],
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
'../app/app.js' : ['sourcemap', 'coverage' ],
},
reporters: ['progress', 'coverage'],
// web server port
port: 9876,
coverageReporter: {
type : 'html',
dir : 'coverage/'
},
// and some other stuff
});
};
現在、私のカバレッジレポートは十分な指標を提供するが、単一typescriptですファイルが、アプリとは関係ありません。 js。
私は、プリプロセッサの設定で何かを混乱させるか、ソースマップを指定する必要があると思います。
Annyのヒント?
それはソースを公開したり、カバレッジレポートでのみコンパイルされたファイルを表示することができますか? – finico