This is my code inside karma.config.js:
I'm using Webpack 3+ for my project.
module.exports = config => {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: ['./src/components/**/*.spec.ts'],
plugins: ['karma-jasmine', 'karma-phantomjs-launcher'],
preprocessors: {
'./src/components/**/*.spec.ts': ['webpack']
},
mime: {
'text/x-typescript': ['ts', 'tsx']
},
webpack: webpackConfig,
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
webpackMiddleware: {
noInfo: true
},
concurrency: Infinity
});
};
After I've included this line of code:
plugins: ['karma-jasmine', 'karma-phantomjs-launcher'],
I got the following error:
Can not load "webpack", it is not registered!
If I don't have this line, everything runs smoothly. The problem is I have to implement PhantomJS. How can I resolve the issue?