Creating Some Tests: Approaches
Explore multiple testing approaches for full stack applications, focusing on efficient API route verification, input validation, and state consistency checks. This lesson helps you understand how to design tests that both prevent server errors and validate correct data updates, improving overall application reliability.
We'll cover the following...
What should be tested in this application, considering that tests require minimal work to develop and be maximally informative?
Approach 1
One approach might be to create a collection of tests, one for each API route and HTTP method, that double-check that the database has been properly updated. For example, when a letter is guessed, has the game progressed correctly? Has it correctly identified whether the game is won or lost? This idea is tempting because it seems to provide a means of assuring that each step is correct. I would disagree. To capture the complexity of the ...