Skip to content

Commit 99f454d

Browse files
Add native ios tests for Crashes module
1 parent 9c002b0 commit 99f454d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

InstabugSample/ios/InstabugSampleTests/InstabugSampleTests.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,5 +512,21 @@ - (void) testgivenBoolean$setViewHierarchyEnabled_whenQuery_thenShouldCallNative
512512
XCTAssertFalse(IBGBugReporting.shouldCaptureViewHierarchy);
513513
}
514514

515+
/*
516+
+------------------------------------------------------------------------+
517+
| Crash Reporting Module |
518+
+------------------------------------------------------------------------+
519+
*/
520+
521+
- (void)testSetCrashReportingEnabled {
522+
id mock = OCMClassMock([Instabug class]);
523+
524+
[self.instabugBridge setCrashReportingEnabled:YES];
525+
XCTAssertTrue(IBGCrashReporting.enabled);
526+
527+
[self.instabugBridge setCrashReportingEnabled:NO];
528+
XCTAssertFalse(IBGCrashReporting.enabled);
529+
}
530+
515531

516532
@end

ios/RNInstabug/InstabugReactBridge.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,12 @@
118118

119119
- (void)setViewHierarchyEnabled:(BOOL)viewHierarchyEnabled;
120120

121+
/*
122+
+------------------------------------------------------------------------+
123+
| Crash Reporting Module |
124+
+------------------------------------------------------------------------+
125+
*/
126+
127+
- (void)setCrashReportingEnabled:(BOOL)enabledCrashReporter;
128+
121129
@end

0 commit comments

Comments
 (0)