| 1055 | } |
| 1056 | |
| 1057 | function createMockScope(): Scope & { capturedData: unknown } { |
| 1058 | const scope = { |
| 1059 | capturedData: undefined as unknown, |
| 1060 | setSDKProcessingMetadata(metadata: { normalizedRequest?: { data?: unknown } }) { |
| 1061 | scope.capturedData = metadata.normalizedRequest?.data; |
| 1062 | }, |
| 1063 | }; |
| 1064 | return scope as Scope & { capturedData: unknown }; |
| 1065 | } |
| 1066 | |
| 1067 | it('captures JSON body', async () => { |
| 1068 | const jsonBody = JSON.stringify({ userId: 42, email: 'user@example.com', action: 'update_profile' }); |