# Category: karma-webpack

## How to include karma and jasmine to AngularJs project served with webpack

I spent the whole day trying to setup karma for my project. I went through all the tutorials and StackOverflow but couldn’t integrate it into my project. My project is served using web pack. I guess the problem is that I can’t get the reference to my root app module. Please help me with this. I tried importing the module using its name, imported the whole files(js) etc but nothing helped. PS: This project has […]

## Unable to run angular4 test cases

I am getting an error (p.s. attached screenshot) when I run ng test in my angular4 app. I have not changed anything as such this just added some test specs in app.component.spec.ts My karma.config.js file has following code module.exports = function (config) { config.set({ basePath: ”, frameworks: [‘jasmine’, ‘angular-cli’], plugins: [ require(‘karma-jasmine’), require(‘karma-chrome-launcher’), require(‘karma-remap-istanbul’), require(‘angular-cli/plugins/karma’) ], files: [ { pattern: ‘./src/test.ts’, watched: false } ], preprocessors: { ‘./src/test.ts’: [‘angular-cli’] }, mime: { ‘text/x-typescript’: [‘ts’,’tsx’] }, […]

## karma-webpack not generate proper coverage for angularjs application using es6 modules without babel

In my angularjs 1.6 application I use webpack to deal with es6 modules, without babel. This works well, but when I use karma-webpack to run my unit tests not generate the correct coverage. Only generate a coverage with as follow. Source: AngularJS