Testing Phoenix Contexts with External API Calls

120
clicks
Testing Phoenix Contexts with External API Calls

Source: reddit.com

Type: Discussion

sectional343 addresses the challenge of testing a Phoenix context function, `list_cards`, which makes external API calls using HTTPoison instead of interacting with a database. The author compares this to testing database-backed entities, where built-in support exists for test databases. The main focus is on finding ways to mock the external API and assert that the API calls were made during testing.

© HashMerge 2024