MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / createMockScope

Function createMockScope

packages/core/test/lib/utils/request.test.ts:1057–1065  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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' });

Callers 1

request.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected