Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
marandaneto committed Oct 20, 2020
commit 45e685effe0f16c8ca844cdd8479b348800dcde8
2 changes: 1 addition & 1 deletion dart/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ abstract class SentryClient {

final data = <String, dynamic>{
'project': projectId,
'event_id': event.eventId,
'event_id': event.eventId.toString(),
'timestamp': formatDateAsIso8601WithSecondPrecision(now),
};

Expand Down
8 changes: 4 additions & 4 deletions dart/lib/src/protocol/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import '../version.dart';
@immutable
class Event {
/// Creates an event.
const Event({
this.eventId,
Event({
SentryId eventId,
this.loggerName,
this.serverName,
this.release,
Expand All @@ -27,7 +27,7 @@ class Event {
this.contexts,
this.breadcrumbs,
this.sdk,
});
}) : eventId = eventId ?? SentryId.newId();

/// Refers to the default fingerprinting algorithm.
///
Expand Down Expand Up @@ -169,7 +169,7 @@ class Event {
};

if (eventId != null) {
json['event_id'] = eventId;
json['event_id'] = eventId.toString();
}

if (loggerName != null) {
Expand Down
2 changes: 1 addition & 1 deletion dart/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void main() {
);
});
test('$Sdk serializes', () {
const event = Event(
final event = Event(
sdk: Sdk(
name: 'sentry.dart.flutter',
version: '4.3.2',
Expand Down
12 changes: 6 additions & 6 deletions dart/test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Future testCaptureException(
httpClient: httpMock,
clock: fakeClockProvider,
compressPayload: compressPayload,
environmentAttributes: const Event(
environmentAttributes: Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down Expand Up @@ -136,7 +136,7 @@ Future testCaptureException(

expect(data, {
'project': '1',
'event_id': 'X' * 32,
'event_id': SentryId.empty().toString(),
'timestamp': '2017-01-02T00:00:00',
'platform': 'javascript',
'sdk': {'version': sdkVersion, 'name': 'sentry.dart'},
Expand All @@ -154,7 +154,7 @@ Future testCaptureException(

expect(data, {
'project': '1',
'event_id': 'X' * 32,
'event_id': SentryId.empty().toString(),
'timestamp': '2017-01-02T00:00:00',
'platform': 'dart',
'exception': [
Expand Down Expand Up @@ -231,7 +231,7 @@ void runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false}) {
httpClient: httpMock,
clock: fakeClockProvider,
compressPayload: false,
environmentAttributes: const Event(
environmentAttributes: Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down Expand Up @@ -286,7 +286,7 @@ void runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false}) {
httpClient: httpMock,
clock: fakeClockProvider,
compressPayload: false,
environmentAttributes: const Event(
environmentAttributes: Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down Expand Up @@ -339,7 +339,7 @@ void runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false}) {
httpClient: httpMock,
clock: fakeClockProvider,
compressPayload: false,
environmentAttributes: const Event(
environmentAttributes: Event(
serverName: 'test.server.com',
release: '1.2.3',
environment: 'staging',
Expand Down