- Building Enterprise JavaScript Applications
- Daniel Li
- 135字
- 2021-07-23 16:31:16
Writing End-to-End Tests
In the previous chapter, Chapter 4, Setting Up Development Tools, we successfully bootstrapped our project. In this chapter, we'll begin the development of our user directory API, which simply consists of Create, Read, Update, and Delete (CRUD) endpoints.
In Chapter 1, The Importance of Good Code, we discussed the importance of testing and briefly outlined the principles and high-level processes of Test-Driven Development (TDD). But theory and practice are two very different things. In this chapter, we will put the TDD approach into practice by first writing End-to-End (E2E) tests, and then using them to drive the development of our API. Specifically, we will do the following:
- Learn about different types of test
- Practice implementing a TDD workflow, specifically following the Red-Green-Refactor cycle
- Write E2E tests with Cucumber and Gherkin