We believe in Test Pyramid.
integration/
- Integration testsunit/
- Unit tests
A subsequent paths the same as the structure of the code in the lib/ directory.
Run all tests:
npm test
Run unit tests:
npm run test:unit
Run integration tests:
npm run test:integration
We use:
- Mocha as testing framework
- Sinon.JS for stubs and spies
- Chai with several plugins for assertions:
- Sinon Chai for Sinon.JS assertions
- Chai as promised for assertions about promises
- Dirty Chai for lint-friendly terminating assertions
We prefer expect
assertions syntax instead of should
.
All tools are bootstrapped before tests:
expect
function is available in global context- Sinon sandbox is created before each test and available as
this.sinon
property in the test's context - Envs from
.env
are loaded before all tests
We use js-evo-services-ctl library to manipulate Evolution's services.
You may find other useful tools for testing in lib/test directory.