Company
Date Published
Author
Liza Shulyayeva
Word count
1528
Language
English
Hacker News points
None

Summary

The author of this text is testing external API calls in Go using the httptest package from Go's standard library. The test uses a table-driven approach with multiple test cases to verify that the code handles data returned by Daily's REST API correctly. The test server is spun up and destroyed for each test case, simulating the call to Daily's API. The author checks if the error returned matches what they expect, then compares the actual values of the participants returned with the expected values. The test also covers failure responses from Daily's API, such as internal server errors.