Skip to content

Commit 69f9d19

Browse files
committed
test(plugin-webhooks): type the captured fetch body as optional, as the sender now declares it
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUZKdq3PK2Sab53cT3
1 parent 8ab601e commit 69f9d19

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/plugins/plugin-webhooks/src/webhook-get-retired-34098.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async function waitFor(check: () => Promise<boolean>, ms = 3000): Promise<void>
7878
}
7979

8080
function makeFetch() {
81-
const calls: Array<{ url: string; method: string; body: string }> = [];
81+
const calls: Array<{ url: string; method: string; body: string | undefined }> = [];
8282
const impl: FetchImpl = async (url, init) => {
8383
calls.push({ url, method: init.method, body: init.body });
8484
return { ok: true, status: 200, async text() { return 'ok'; } };
@@ -259,7 +259,7 @@ describe('webhook method GET retired — a stored GET row is parked, never conve
259259
expect(calls).toHaveLength(1);
260260
expect(calls[0].method).toBe('POST');
261261
expect(calls[0].url).toBe('https://receiver.invalid/post_hook');
262-
expect(JSON.parse(calls[0].body)).toMatchObject({ object: 'probe_task', action: 'created' });
262+
expect(JSON.parse(calls[0].body ?? '')).toMatchObject({ object: 'probe_task', action: 'created' });
263263
expect(errors).toEqual([]);
264264
} finally {
265265
await enqueuer.stop();

0 commit comments

Comments
 (0)