The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Initialize a Webpack Project with Karma for Testing

Initialize a Webpack Project with Karma for Testing

5:22
There are several steps involved with setting up [`Karma`](http://karma-runner.github.io/) to work on your webpack project. In this first step we'll initialize our karma configuration and setup our `package.json` `scripts`.
Watch this lesson now
Avatar
egghead.io

There are several steps involved with setting up Karma to work on your webpack project. In this first step we'll initialize our karma configuration and setup our package.json scripts.

Avatar
Carlos

Maybe it's a good idea to clarify that Karma is for browser testing, while i had a fun time setting up until the vid 15, where i found out it can't be used to test node.js (guess i'll have to test with Narma to run karma inside NW.js environment, tough i would like it to use Electron better).

Update:
Actually never mind, i managed to get it working by using karma-nodewebkit-launcher, it's a weird workaround but it works.

In reply to egghead.io
Avatar
Kent C.

Hey Carlos,
If you want to write tests for code that can run in Node (React included actually), then I highly recommend using Jest. I have a handful of Egghead.io lessons on this topic as well: kcd.im/egghead-jest. Good luck!

In reply to Carlos
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?