Jest preset for integration-testing
Jest preset for integration-testing
> @tramvai/cli and puppeteer should be installed separately
``bash`
npm i --save-dev @tramvai/test-integration-jest
Using this jest preset you can run integration tests in watch mode. In this case, application itself will be launched only once and will work in background.
1. Add preset @tramvai/test-integration-jest to jest.integration.config.js:
`js`
module.exports = {
preset: '@tramvai/test-integration-jest',
};
2. Add new script for running tests in watch mode to package.json:
`json`
{
"scripts": {
"test:integration": "jest -w=3 --config ./jest.integration.config.js",
"test:integration:watch": "jest --runInBand --watch --config ./jest.integration.config.js"
}
}
3. Run some test with yarn test:integration:watch . In this case you are able to go to local url http://localhost:3000 and see application at work.
Minimal set of dependencies for running jest:
`bash``
npm i --save-dev jest @jest/types