Testing Requirements
December 16, 2020 ยท View on GitHub
- All new and updated back-end code should have a corresponding unit tests
- All new and existing unit tests should pass locally before opening a Pull-Request
- Linting should pass locally before opening a Pull-Request
Running Front-End Unit Tests (Not Currently Required)
- The Angular unit tests have not been implemented so please skip this section
- Run
npm run test:frontto execute the unit tests via Karma - Follow the recommended guidelines for Front-End Testing
Running Back-End Unit Tests
- Run
npm run test:nodeto execute the unit tests via Jest - Test coverage report can be opened in browser located in:
coverage/lcov-report/index.html - Follow the recommended guidelines for Back-End Testing
Running All Tests
- Run
npm run testto execute the unit tests.
Linting
npm run lint
In case your PR is failing from style guide issues try running npm run lint:fix - this will fix all syntax or code style issues automatically without breaking your code.
Prettier
Bulwark uses Prettier for opinionating code formatting. It is recommended to run it from your editor. Use the following steps to integrate Prettier into your editor.