import { INestApplicationContext } from '@nestjs/common'; import { WebhookDeliveryWorker } from '../../src/webhooks/webhook-delivery.worker'; /** * Sends the due webhook deliveries of the given subscriptions - and nothing * else, so e2e files running in parallel never send each other's * deliveries. Without a worker, e2e tests call this after the request * whose webhooks they want to assert. Returns how many were claimed. */ export function deliverWebhooks( app: INestApplicationContext, subscriptionIds: readonly string[], ): Promise { return app.get(WebhookDeliveryWorker).drain({ subscriptionIds }); }