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
3
votes
0 answers

Karma, Webpack, Tape & Absolute path issue

This is an interesting situation. The puzzle is this: The component's name is TODO Controller.js import Component from 'component'; import View from 'app-folder/components/todo/view'; export default Component.extend({ viewClass:…
MightyMight
  • 109
  • 1
  • 10
3
votes
1 answer

Is it possible to transpile local modules from node_module?

I have 2 typescript projects which contain few classes. I have added Project1's dependency in the Project2 in package.json { "name": "Project2", "dependencies": { "@Project1": "file:../Project1/dist" } } Both the project are built…
Ashish Mulaye
  • 256
  • 1
  • 3
  • 13
3
votes
0 answers

How do I use Node Typescript types with Karma-Webpack

I have Webpack configured for transpiling my TS files in Karma. I have also included Node and CoreJS types. However, when I try to run my tests I get... ERROR in ./test/karma/test.bundle.ts (18,30): error TS2339: Property 'context' does not exist on…
Jackie
  • 21,969
  • 32
  • 147
  • 289
3
votes
0 answers

Debugging Karma, mocha & webpack inside IntelliJ

I am failing to debug mocha unit tests, using karma and webpack. I have the Karma plugin installed, and the chrome extension. But when I'm debugging the IDE would just ignore any breakpoints. Example of a unit test: var assert =…
Ohad Navon
  • 1,693
  • 1
  • 14
  • 19
3
votes
0 answers

karma-webpack-tape: Show Line Number when Test Fails

As the title implies, I want to be able to see the line number when a test fails in my suite. I'm relying on the karma-tap plugin, the tap framework, and dots reporter. A little context: source-maps are working properly, so exceptions thrown in a…
ucileamarn
  • 73
  • 6
3
votes
1 answer

How to use webpack multiple entries with karma?

I have webpack config with multiple entries: entry: { 'js/app': ['./css/app/style.scss', './js/app/index.js'], 'js/vendor': ['./js/vendor/index.js', './css/vendor/index.css'], 'js/snippets': './js/snippets/index.js' }, and I don't want to…
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
2
votes
2 answers

NativeScript Angular + Karma - ReferenceError: window is not defined

So I decided to add unit testing to my NS7/NG11 app, followed instructions from NS website and got to the point where the app would start but the screen is blank (all white). Initialized tests with ns test init, manually updated karma-webpack in…
2
votes
0 answers

Can't create code coverage for VUE files with karma, webpack and typescript

I am trying to create code coverage for VUE files using typescript in karma and webpack. I am using istanbul-instrumenter-loader as a post process after but keep getting. Everything works okay for pure .ts files, but when incluiding vue files I…
2
votes
0 answers

Karma-Webpack wiring issues with with NpmPrettyMuch

The Problem I am attempting to run a Cucumber test using a Karma test runner in my Npm project using the karma-cucumber-js adapter. However, when running my test, I find the following error in my console: START: PhantomJS 2.1.1 (Mac OS X 0.0.0)…
AV2KL
  • 21
  • 3
2
votes
0 answers

VueJS + Karma + Webpack 4 : no test are run

recently i decided to migrate from webpack 3 to webpack 4. It almost works well until i started to run tests. If my application really works well, in fact, no tests are detected by Karma. I use webpack throught a wrapper (symfony encore) which works…
Rebolon
  • 1,257
  • 11
  • 29
2
votes
4 answers

karma-webpack not running tests

edit: from another answer I decided to try upgrading from karma-webpack 3.0.5 to 4.0.0-rc.2, and I started getting actual errors. It started complaining that angular was not defined, and then I realized I was importing my home.spec.js file from the…
robert.bo.roth
  • 1,343
  • 3
  • 14
  • 24
2
votes
1 answer

Can anyone provide a webpack4 & Karma configuration that works?

I recently upgraded to Webpack4 and I am running into issues where karma start will run my webpack build and then do nothing. Just sits there. I was curious if anyone had a webpack4 configuration and a karma configuration that works they could…
Corey
  • 351
  • 1
  • 2
  • 14
2
votes
1 answer

Angular TestBed - Karma/Jasmine | Unexpected value imported 'BrowserDynamicTestingModule' | Angular AOT

Test bed code example, following guideline https://angular.io/guide/testing - describe("Login", () => { let loginService: LoginService; beforeEach(() => { TestBed.configureTestingModule( { providers: [LoginService] } ); …
user3333134
  • 389
  • 1
  • 6
  • 17
2
votes
1 answer

Error after including plugins in karma.config.js

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',…
EugenSunic
  • 13,162
  • 13
  • 64
  • 86
2
votes
0 answers

Ionic 3 and Angular 4 - Karma does not run the unit tests instantly. It takes a minute or above to start. Whats causing the slowness?

Using Ionic 3 and Angular 4 - Karma Test Runner does not run the unit tests instantly. It takes about a minute or above to start. Is this normal or there is something I can do to speed it up? This image shows the delay Following is the karma config…
1 2
3
11 12