How to debug karma unit tests?
stefek99 opened this issue · 1 comments
stefek99 commented
- Installed
npm install karma-chrome-launcher --save-dev - Added following to
package.json:"test-debug": "karma start --browsers=Chrome --single-run=false" - When running
npm start test-debugI'm getting following error:
Chrome 51.0.2704 (Mac OS X 10.11.5) ERROR
Uncaught Error: Cannot find module "./app"
at http://localhost:9876/context.html:5
Workaround
Edit karma.conf.js and override --browsers=Chrome --single-run=false
Any ideas how to make it better?
phra commented
just install karma-chrome-launcher as development dependency and add chrome to karma browsers list in webpack config.
browsers: [
// Run tests using PhantomJS
'PhantomJS',
'Chrome'
]