Custom Test Helpers

We now need to create the json() test-helper method which our BooksApiTest is dependant on.

Initially we are going to take a common TDD strategy of adding a fake implementation just to get us one step closer to a passing test. We can then start the extracting and refactoring.

So we can use an anonymous class for the time being instead of having to create a real Response class...it's a good habit to stay as close as possible to a passing test, even if it means you have to employ a temporary fake implementation.

Branch: https://github.com/GaryClarke/pest-tdd/tree/3-custom-test-helpers

Complete and Continue  
Discussion

0 comments