MCPcopy Create free account
hub / github.com/getsentry/sentry-react-native / createClientWithSpy

Function createClientWithSpy

packages/core/test/client.test.ts:918–936  ·  view source on GitHub ↗
(options: Partial<ReactNativeClientOptions>)

Source from the content-addressed store, hash-verified

916}
917
918function createClientWithSpy(options: Partial<ReactNativeClientOptions>) {
919 const onSpy = jest.fn();
920 class SpyClient extends ReactNativeClient {
921 public on(hook: string, callback: unknown): () => void {
922 onSpy(hook, callback);
923 // @ts-expect-error - the public interface doesn't allow string and unknown
924 return super.on(hook, callback);
925 }
926 }
927
928 return {
929 client: new SpyClient({
930 ...DEFAULT_OPTIONS,
931 dsn: EXAMPLE_DSN,
932 ...options,
933 }),
934 onSpy,
935 };
936}

Callers 1

client.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected