Skip to content
Merged
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
Use 'formatDateAsIso8601WithSecondPrecision' for timestamp of breadcrumb
  • Loading branch information
yrom committed Oct 8, 2019
commit ce1f396b60c79d11bfa33918e21f665de9caa329
20 changes: 18 additions & 2 deletions test/sentry_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,22 @@ void main() {
});

group('$Event', () {
test('$Breadcrumb serializes', () {
expect(
Breadcrumb(
"example log",
DateTime.utc(2019),
level: SeverityLevel.debug,
category: "test",
).toJson(),
<String, dynamic>{
'timestamp': '2019-01-01T00:00:00',
'message': 'example log',
'category': 'test',
'level': 'debug',
},
);
});
test('serializes to JSON', () {
final user = new User(
id: "user_id",
Expand All @@ -317,7 +333,7 @@ void main() {
extras: {"foo": "bar"});

final breadcrumbs = [
Breadcrumb("test log", DateTime.fromMillisecondsSinceEpoch(1200 * 1000),
Breadcrumb("test log", DateTime.utc(2019),
level: SeverityLevel.debug, category: "test"),
];

Expand Down Expand Up @@ -363,7 +379,7 @@ void main() {
'breadcrumbs': {
'values': [
{
'timestamp': 1200,
'timestamp': '2019-01-01T00:00:00',
'message': 'test log',
'category': 'test',
'level': 'debug',
Expand Down