Skip to content

Commit

Permalink
fix platform to ios in sentry_client_test
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Jul 21, 2022
1 parent 40bfad8 commit f7faa37
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class SentryClient {
this is a signal that the app would crash and android would lose the breadcrumbs by the time the app is restarted to read
the envelope.
*/
//preparedEvent = _eventWithRemovedBreadcrumbsIfHandled(preparedEvent);
preparedEvent = _eventWithRemovedBreadcrumbsIfHandled(preparedEvent);
}

final envelope = SentryEnvelope.fromEvent(
Expand Down
6 changes: 4 additions & 2 deletions dart/test/mocks/mock_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ class MockPlatform extends Platform with NoSuchMethodProvider {
return MockPlatform(os: 'android');
}

factory MockPlatform.iOS() {
return MockPlatform(os: 'ios');
}

@override
String operatingSystem;

@override
bool get isAndroid => (operatingSystem == 'android');
}
6 changes: 2 additions & 4 deletions dart/test/sentry_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,6 @@ void main() {
final capturedEnvelope = fixture.transport.envelopes.first;
final capturedEvent = await eventFromEnvelope(capturedEnvelope);

expect(fixture.options.enableScopeSync, true);
expect(fixture.options.platformChecker.platform.isAndroid, false);

expect(capturedEvent.user!.id, eventUser.id);
expect(capturedEvent.level!.name, SentryLevel.warning.name);
expect(capturedEvent.transaction, eventTransaction);
Expand Down Expand Up @@ -1179,7 +1176,8 @@ class Fixture {
final recorder = MockClientReportRecorder();
final transport = MockTransport();

final options = SentryOptions(dsn: fakeDsn);
final options = SentryOptions(dsn: fakeDsn)
..platformChecker = MockPlatformChecker(platform: MockPlatform.iOS());

late SentryTransactionContext _context;
late SentryTracer tracer;
Expand Down

0 comments on commit f7faa37

Please sign in to comment.