DEV Community

Discussion on: My $646 mistake with PHP

Collapse
 
jaywhy13 profile image
Jean-Mark Wright

Thanks for sharing this, and capturing the lessons you learned along the way! I believe this example underscores the importance of targeted testing to confirm expected behavior.
Assuming that you have a mock setup for the test, some examples of tests that come to mind are:

  • Verify that there's only one call to the API when there's no next page token
  • Verify that sleeps happen when there's a next page token
  • Verify the number of calls to the API when there are multiple pages