1.3 KiB
1.3 KiB
Testing
Single test run
npm test
(alternatively runkarma start --single-run
)npm run lint
to run ESLint
Info on linting setup and .eslintrc rules tweaks.
Tests during development
Start Karma to run tests after every change
npm run test:watch
.
Debugging tests
- option
- use
console.log
in the test and see the output in karma server output
- option
- install karma-chrome-launcher npm module
npm install karma-chrome-launcher --save-dev
- replace/add 'Chrome' to browsers in
karma.conf.js
- now Karma will launch Chrome to run the tests
- use
debugger;
statement in test code to add breakpoints- in Karma Chrome window click 'debug' button and debug in chrome developer tools as usual
- optionally you can use karma-jasmine-html-reporter for better test output
- make sure you don't push those changes to
karma.conf.js
andpackage.json
as part of your patch