Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 878 Bytes

unit-testing.md

File metadata and controls

29 lines (19 loc) · 878 Bytes

↤ Developer Overview

Unit Testing and Code Coverage Reports

Unit Tests

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

Code Coverage

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%