Weather Bar makes use of the Karma test runner and the Mocha test framework (with Chai) for unit testing.
Both Mocha and Chai are integrated using karma-mocha
and karma-chai
respectively, so all APIs such as expect
are globally available in test files.
To run tests:
# run unit & end-to-end tests
npm test
# lint all JS/Vue component files in `src/`
npm run lint
Running npm test
will also generate code coverage reports in ./test/unit/coverage/
. Unit Tests will automatically fail if Code Coverage reports fall below the following thresholds:
- Statements: 75%
- Branches: 75%
- Functions: 75%
- Lines: 75%