MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / waitForWebhookEvents

Function waitForWebhookEvents

tests/helpers_test.go:287–302  ·  view source on GitHub ↗
(t *testing.T, webhookPath string, expectedCount int, timeout time.Duration)

Source from the content-addressed store, hash-verified

285}
286
287func waitForWebhookEvents(t *testing.T, webhookPath string, expectedCount int, timeout time.Duration) []wmJournal.GetRequestResponse {
288 t.Helper()
289 deadline := time.Now().Add(timeout)
290
291 for time.Now().Before(deadline) {
292 requests := findWebhookRequests(t, webhookPath)
293 if len(requests) >= expectedCount {
294 return requests
295 }
296 time.Sleep(500 * time.Millisecond)
297 }
298
299 requests := findWebhookRequests(t, webhookPath)
300 require.GreaterOrEqual(t, len(requests), expectedCount, "expected at least %d webhook events on %s, got %d", expectedCount, webhookPath, len(requests))
301 return requests
302}
303
304func waitForFCMPush(t *testing.T, messageID string, timeout time.Duration) []wmJournal.GetRequestResponse {
305 t.Helper()

Callers 4

TestSendSMS_EncryptedFunction · 0.85
TestReceiveSMS_EncryptedFunction · 0.85
TestSendSMS_RateLimitFunction · 0.85

Calls 1

findWebhookRequestsFunction · 0.85

Tested by

no test coverage detected