我不断收到此错误Uncaught SyntaxError:意外令牌{每当我尝试运行我的angular5应用程序测试用例时。
karma.config.js
module.exports = function (config) {
config.set({
basePath: '.',
frameworks: ['jasmine', 'karma-typescript'],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './boot-tests.ts' },
{ pattern: '../app/**/*.+(ts|html)' }
],
preprocessors: {
'**/*.ts': ['webpack', 'karma-typescript']
},
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
transforms: [
require("karma-typescript-angular2-transform")
]
},
compilerOptions: {
lib: ["ES2015", "DOM"]
}
},
//proxies: {
// "../app/": "/clientApp/app/"
//},
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
reporters: ['progress', 'karma-typescript'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
mime: { 'application/javascript': ['ts', 'tsx'] },
singleRun: true,
webpack: require('../../webpack.config.js')().filter(config => config.target !== 'node'), // Test against client bundle, because tests run in a browser
webpackMiddleware: { stats: 'errors-only' }
});
};
我如上所述配置了karma.config.js文件。任何想法为什么我会收到此错误。