Automated testing for microservices
You can find the code here: https://github.com/facebook/jest.
If you’re starting a new project, you can install Jest like this:
1
npm install --save-dev jest
We used the –save-dev argument to save Jest as a development dependency in package.json. We’ll only use Jest in our development or testing environment, so we save it as a development dependency to exclude it from our production environment.
When starting a fresh project, create your own Jest configuration file like this:
1
npx jest --init
The purpose of mocking is to isolate the code we’re testing. Isolating particular sections of code allows us to focus on just testing only that code and nothing else. Isolation is important for unit testing and test-driven development (TDD).
Playwright was created by Microsoft as an open source project. You can find the code for it on GitHub here: https://github.com/microsoft/playwright.
1
2
3
npm install --save-dev @playwright/test
npm init playwright@latest