Hacker News new | ask | show | jobs
by mosselman 3494 days ago
It would have been interesting to read about tests for web-hooks. How do you do integration testing for example?
1 comments

In the past when I used to support webhooks what I did was very simple:

* Receive the HTTP POST submission to my hook end-point.

* Save this data in a queue.

* Return to the hook-caller "200 OK - $ID".

This was better than trying to initiate a long-running job as a result of the hook, and meant that I could trigger "fake webhooks" just by adding data to the queue manually.

I'm sure there are other approaches, but this is a flexible one that also gave the benefit of being simple. (For the queue I just used Redis.)