我收到每个js文件的消息。打字稿文件工作正常。我尝试添加--source-map=false
标志,但效果不佳。我的tsconfig.json
文件也已经有sourceMap: false
,但也许不应该影响我的问题,因为它仅影响js文件?
这是我第一次使用karma,因此我想我可能在karma.conf.js中缺少javascript文件。
karma.conf.js文件:
module.exports = function (config) {
config.set({
hostname: 'localhost',basePath: '.',frameworks: ['jasmine','karma-typescript'],files: [
// [some patterns ...]
// [some ts and js files (production code),e.g:] ...
'src/app/spas/tds-web/**/*.ts','spec/**/*.ts','spec/**/*.js'
],exclude: [''],preprocessors: {
'src/**/*.js': ['coverage'],'**/*.ts': ['karma-typescript','coverage'],},karmaTypescriptConfig: {
coverageOptions: {
exclude: [/(\-|\.)(d|spec|test)\.ts$/i]
},reports: {
'html': 'coverage','lcovonly': {
'directory': 'coverage/typescript','subdirectory': 'lcov','filename': 'lcov.info','text-summary': ''
}
},reporters: ['progress','karma-typescript',port: 9876,colors: true,logLevel: config.LOG_INFO,browsers: ['chromeWithoutSecurity'],browserNoactivityTimeout: 100000,customLaunchers: {
phanthomjsWithoutSecurity: {
base: 'PhantomJS',flags: ['--ignore-ssl-errors=true','--web-security=false']
},chromeWithoutSecurity: {
base: 'Chrome',flags: ['--args','--ignore-certificate-errors']
}
},singleRun: true,});
};
我在karma.conf.js
的{{1}}收到的每个js文件的完整消息:
files