Skip to content

Commit 2f5046b

Browse files
committed
Use SentrySDKInternal for options
1 parent 18a9682 commit 2f5046b

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#import <Foundation/Foundation.h>
22
#import <RNSentry/RNSentry.h>
3-
@import Sentry;
43

4+
@class SentryOptions;
5+
6+
#if CROSS_PLATFORM_TEST
7+
@interface SentrySDKInternal : NSObject
8+
#else
59
@interface
6-
SentrySDK (PrivateTests)
7-
- (nullable SentryOptions *)options;
10+
SentrySDK (Private)
11+
#endif
12+
+ (nullable SentryOptions *)options;
813
@end

packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#import <Sentry/SentryDebugImageProvider+HybridSDKs.h>
55
#import <UIKit/UIKit.h>
66
#import <XCTest/XCTest.h>
7+
@import Sentry;
78

89
@interface RNSentryInitNativeSdkTests : XCTestCase
910

@@ -464,8 +465,13 @@ - (void)prepareNativeFrameMocksWithLocalSymbolication:(BOOL)debug
464465
SentryOptions *sentryOptions = [[SentryOptions alloc] init];
465466
sentryOptions.debug = debug; // no local symbolication
466467

468+
#if CROSS_PLATFORM_TEST
469+
id sentrySDKMock = OCMClassMock([SentrySDKInternal class]);
470+
OCMStub([(Class)sentrySDKMock options]).andReturn(sentryOptions);
471+
#else
467472
id sentrySDKMock = OCMClassMock([SentrySDK class]);
468-
OCMStub([(SentrySDK *)sentrySDKMock options]).andReturn(sentryOptions);
473+
OCMStub([(Class)sentrySDKMock options]).andReturn(sentryOptions);
474+
#endif
469475

470476
id sentryDependencyContainerMock = OCMClassMock([SentryDependencyContainer class]);
471477
OCMStub(ClassMethod([sentryDependencyContainerMock sharedInstance]))

packages/core/ios/RNSentry.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99

1010
#import <Sentry/Sentry.h>
1111
#import <Sentry/SentryDebugImageProvider.h>
12-
#import <Sentry/SentryOptions.h>
1312

1413
typedef int (*SymbolicateCallbackType)(const void *, Dl_info *);
1514

15+
@class SentryOptions;
16+
1617
#if CROSS_PLATFORM_TEST
1718
@interface SentrySDKInternal : NSObject
1819
#else

0 commit comments

Comments
 (0)