I'm currently configuring Karma for my Angular 2 application and I seem to be facing an issue with a missing plugin. Could anyone provide assistance with this matter? I am utilizing the following repository as a reference: https://github.com/AngularClass/angular2-webpack-starter. Below are the dev-dependencies listed in my Karma setup:
"istanbul": "^0.4.5",
"jasmine-core": "^2.4.1",
"json-loader": "^0.5.4",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-istanbul-reporter": "0.0.1",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.2.0",
"karma-remap-coverage": "^0.1.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"lodash-webpack-plugin": "^0.10.2",
"npm-scripts-info": "^0.3.6",
"raw-loader": "0.5.1",
"rimraf": "^2.5.2",
"source-map": "^0.5.6",
"source-map-loader": "^0.1.5",
Additionally, here is a snippet from my karma.conf.js file:
var webpackConfig = require('./webpack.test');
module.exports = function (config) {
var _config = {
basePath: '',
// more configuration settings...
};
config.set(_config);
};
The error message that appears when running the code is:
Chrome 54.0.2840 (Windows 7 0.0.0) ERROR
Uncaught Error: Module parse failed: {location}\src\app\app.component.spec.ts Unexpected t
oken (13:57)
You may need an appropriate loader to handle this file type.
| ]}));
|
| it('should have a state', inject([ AppComponent ], (app: AppComponent) => {
| expect(app.state).toEqual('blank');
| }));
This error is seen at config/karma-test-shim.js:69437