Summary
In this chapter, we discussed software testing by learning how to design integration and end-to-end tests. You learned how to use the Jest framework to write tests in React projects. You saw how to use the describe
and test
(or it
) methods to write and organize related tests. You also learned how to execute instructions before and after tests run using the beforeAll
, beforeEach
, afterAll
, and afterEach
methods.
You then learned how to write tests using Puppeteer and Headless Chrome by simulating user interaction on your interface. To demonstrate the use of Puppeteer with Jest, we created an integration test to ensure the Umi locale plugin works correctly with the layout plugin and also created an end-to-end test to ensure the feature to edit an opportunity works as expected.
In the next chapter, we will learn how to compile and deploy our applications to online services.