File tree Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1111### Features
1212
1313- Adds GraphQL integration ([ #5299 ] ( https://github.com/getsentry/sentry-react-native/pull/5299 ) )
14+ - Adds Supabase integration ([ #5296 ] ( https://github.com/getsentry/sentry-react-native/pull/5296 ) )
1415
1516### Dependencies
1617
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export { breadcrumbsIntegration } from './breadcrumbs';
2626export { primitiveTagIntegration } from './primitiveTagIntegration' ;
2727export { logEnricherIntegration } from './logEnricherIntegration' ;
2828export { graphqlIntegration } from './graphql' ;
29+ export { supabaseIntegration } from './supabase' ;
2930
3031export {
3132 browserApiErrorsIntegration ,
Original file line number Diff line number Diff line change 1+ import { supabaseIntegration as browserSupabaseIntegration } from '@sentry/browser' ;
2+ import type { Integration } from '@sentry/core' ;
3+
4+ type SupabaseReactNativeIntegrationOptions = {
5+ supabaseClient : unknown ;
6+ } ;
7+
8+ /**
9+ * Use this integration to instrument your Supabase client.
10+ *
11+ * Learn more about Supabase at https://supabase.com
12+ */
13+ export function supabaseIntegration ( options : SupabaseReactNativeIntegrationOptions ) : Integration {
14+ return browserSupabaseIntegration ( { supabaseClient : options . supabaseClient } ) ;
15+ }
Original file line number Diff line number Diff line change 1+ import { supabaseIntegration as browserSupabaseIntegration } from '@sentry/browser' ;
2+ import { supabaseIntegration } from '../../src/js' ;
3+
4+ jest . mock ( '@sentry/browser' , ( ) => ( {
5+ supabaseIntegration : jest . fn ( ) ,
6+ } ) ) ;
7+
8+ function createMockClient ( ) {
9+ return {
10+ init : jest . fn ( ) ,
11+ } ;
12+ }
13+
14+ describe ( 'supabase' , ( ) => {
15+ afterEach ( ( ) => {
16+ jest . resetAllMocks ( ) ;
17+ } ) ;
18+
19+ // this test is sufficient to test the integration because everything else
20+ // is covered by the integration tests in the @sentry /browser package
21+ it ( 'passes React Native options to browserSupabaseIntegration' , ( ) => {
22+ const mockClient = createMockClient ( ) ;
23+ supabaseIntegration ( { supabaseClient : mockClient } ) ;
24+
25+ expect ( browserSupabaseIntegration ) . toHaveBeenCalledWith ( {
26+ supabaseClient : mockClient ,
27+ } ) ;
28+ } ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments