我想知道是否有可能对Karma上的.ts
文件进行测试覆盖。
我已经用javascript
编写了所有测试,并且开始迁移以打字稿输入源文件
迁移所有测试都可以之后,我的意思是正在测试的.ts
个文件。但是很遗憾,typescript
个文件的测试覆盖范围消失了。
正如我所说的,测试是用JavaScript编写的。
./src
中的某些文件位于.ts
中,另一些文件位于.js
有我的业力config
config.set({
frameworks: ['jasmine-ajax','jasmine'],reporters:['mocha','coverage'],files: [
{ pattern: 'test/**/*_test.js',watched: false }
],colors: true,autoWatch: true,singleRun: false,coverageReporter: {
dir: '.',reporters: [
{ type: 'text',subdir: 'coverage' },{ type: 'html',{ type: 'lcovonly',subdir: '.',file: 'lcov.info' }
]
},preprocessors: {
'test/**/*_test.js': ['webpack','sourcemap']
},webpack: build.config('test'),webpackMiddleware: {
stats: 'errors-only'
},browsers: BROWSERS,client: {
captureConsole: false,mocha: {
bail: true
}
}
})
我的Webpack包含.js
个文件的babel-loader
和ts-loader
用于.ts
文件