MCPcopy Index your code
hub / github.com/getsentry/sentry-react-native / setupTestClient

Function setupTestClient

packages/core/test/mocks/client.ts:108–122  ·  view source on GitHub ↗
(options: Partial<TestClientOptions> = {})

Source from the content-addressed store, hash-verified

106}
107
108export function setupTestClient(options: Partial<TestClientOptions> = {}): TestClient {
109 getCurrentScope().clear();
110 getIsolationScope().clear();
111 getGlobalScope().clear();
112
113 const finalOptions = getDefaultTestClientOptions({ tracesSampleRate: 1.0, ...options });
114 const client = new TestClient(finalOptions);
115 setCurrentClient(client);
116 client.init();
117
118 // @ts-expect-error Only available on ReactNativeClient
119 client.emit('afterInit');
120
121 return client;
122}

Calls 4

clearMethod · 0.80
emitMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected