Questions tagged [karma-webpack]

npm package to connect karma with webpack

npm package to connect karma with webpack https://github.com/webpack/karma-webpack

171 questions
1
vote
0 answers

karma-webpack sourcemaps not working (Type script files not load to web browser for debug)

I'm using Karma-Webpack. Karma Webpack sourcemaps not working When I execute tests using karma in Chrome, the source files for my specs appear unreadable in the debugger. However, the system under test files (my application source) is…
lilan silva
  • 1,896
  • 1
  • 14
  • 19
1
vote
0 answers

jasmine html loader is not loading in angular 4 webpack

I am trying to unit test my angular app.as am new to this karama test i am trying to karma,jasmine and protractor..i ve downloaded and all karma dependencies.i am using angular webpack version in visual studio 2017.i am facing some issues…
baby
  • 11
  • 2
1
vote
1 answer

Karma + Jasmine - Can't find variable require

i'm trying to implement some tests in my VueJS project using karma and jasmine. I can launch basic test such as: describe('canary', function () { // asserting JavaScript options it('should run', function () { expect(true).toBe(true) }) …
1
vote
1 answer

Karma-typescript Interface XXX cannot simultaneously extend types ' YYY

My tsconfig.json is { "compilerOptions": { "outDir": "./dist/", "sourceMap": true, "module": "es6", "target": "es5", "jsx": "react", "allowJs": true, "preserveConstEnums": true, "removeComments": true, …
Kousha
  • 32,871
  • 51
  • 172
  • 296
1
vote
0 answers

Karma-webpack angularjs typescript broken source map in inline mode

I have the following configuration: karma.conf.js var webpack = require('./webpack/webpack.dev'); var port = process.env['KARMA_PORT'] || '9876'; module.exports = (config) => { config.set({ basePath: '', frameworks: ['modules',…
1
vote
0 answers

Not able to run Karma with Webpack 3

Am using webpack :3.8.1, karma:1.7.1 and karma-webpack:2.0.6 . When tried to run karma it shows ERROR [preprocess]: Can not load "webpack", it is not registered!. Are these latest versions not compatible ? Should I do something on the config…
Santhosh
  • 534
  • 9
  • 24
1
vote
2 answers

Karma Webpack Jasmine Unit Testing not working

I am trying to setup testing with Karma, Jasmine, Webpack in AngularJS. My webpack is working fine and I can run my website using npm start A simple test works fine but the moment I try to add my app.js everything goes downhill. I have tried many…
Sallu
  • 479
  • 6
  • 17
1
vote
1 answer

Karma-Jasmine TypeError: this.ngRedux.getState is not a function

I'm trying to run a test on one of my modules, which handles ngRedux. while running the test, i get TypeError: this.ngRedux.getState is not a function The test im running is a simple it("should create component:", () => { …
eyalewin
  • 360
  • 4
  • 20
1
vote
1 answer

Karma is ignoring mime setting and tests fail in Chrome

I am getting the following error when trying to run my unit tests. Refused to execute script from 'http://localhost:9876/base/tests/test.ts' because its MIME type ('video/mp2t') is not executable. The problem is that karma is serving test.ts with…
Derek
  • 967
  • 1
  • 9
  • 16
1
vote
1 answer

babel webpack configuration ignored in karma.conf.js?

I am trying to make my first JS unit test with Karma and Jasmin. I am testing a react app. I generated the karma config with "karma init" and modified it, see below for the karma.config.js The webpack.config is required in the karma.config.js, but…
edbras
  • 4,145
  • 9
  • 41
  • 78
1
vote
1 answer

Typescript throwing error during unit tests that variable undefined even though I have declare var statement at beginning of file

I'm using angular(2) and typescript. I'm using the moment library to convert dates so I have this function inside one of my utility classes: static isoStringToDateObj(isoDateString: string): Date { // For unit tests and any environment where…
Alex Egli
  • 1,884
  • 2
  • 24
  • 43
1
vote
1 answer

Karma can't resolve dependency 'kotlin' in kotlin-frontend-plugin

I have been trying to get this to work for a day or so now with no luck. Webpack doesn't seem to be injecting the kotlin npm module into my tests, even though it is loaded by webpack. So it throws the below error saying it can't find it. Here's the…
Graham
  • 5,488
  • 13
  • 57
  • 92
1
vote
1 answer

Karma and Angular2 - Mixing Isolated and non-isolated tests causes runtime injection failure

I am trying to create a model to back an Angular 2 app. I am new to Angular2, so please bear with me. The model is a port from an older Java code base that we want to move to TypeScript. In doing so, we are recreating tests that would be classified…
Nava2
  • 437
  • 3
  • 16
1
vote
1 answer

How to run AngularJS unit tests against the minified app with Webpack and Karma

I'm working on an AngularJS application. We have a large existing codebase which we are moving to Webpack 2 in preparation for ng-upgrade. However we can't figure out how to run our Jasmine unit tests against the minified app. We have modeled our…
Benjamin
  • 1,372
  • 2
  • 12
  • 20
1
vote
1 answer

Karma "request.replace is not a function" error

I am using Karma 1.5.0, Webpack 2.3.2 and Karma-Webpack 2.0.3. When I build my project (meaning no Karma) it builds with Webpack fine. But when I try to run my Karma tests I get the following error: TypeError: request.replace is not a…
Vaccano
  • 78,325
  • 149
  • 468
  • 850