Reputation: 1596
I implemented a Service which hide all of Twilio's wiring, and am trying to write tests for it. I found test credentials etc., but when I try to test my flow, I get this message:
I'm a little unsure how to actually test the "Verify" flow from Twilio using test credentials. Has anybody done this before?
Upvotes: 2
Views: 1548
Reputation: 3889
Heyooo. Twilio Developer Evangelist here. 👋
Unfortunately, I have to say that the test credentials only work for specific resources/endpoints right now – meaning buying phone numbers, sending sms and making phone calls.
Requests to any other resource with test credentials will receive a 403 Forbidden response. In the future, we may enable these resources for testing as well.
Only way I see to test the Twilio Helper library in a unit test environment, like the one I see you're going, is to mock the twilio
module. This way you're not testing Twilio's endpoints but if you're code behaves like it should.
Let me know if that helps. 👋
Upvotes: 2