Skip to content
Merged
Changes from all commits
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
boottime test independent of test machine timezone
  • Loading branch information
maks committed Jan 13, 2020
commit a124b0b3c060849079c4f5c3516f9a4995af815b
5 changes: 3 additions & 2 deletions test/contexts_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:test/test.dart';

void main() {
group(Contexts, () {
final testBootTime = DateTime.fromMicrosecondsSinceEpoch(0);
test('serializes to JSON', () {
final testDevice = Device(
name: 'testDevice',
Expand All @@ -32,7 +33,7 @@ void main() {
freeStorage: 1234567,
externalStorageSize: 98765,
externalFreeStorage: 98765,
bootTime: DateTime.fromMicrosecondsSinceEpoch(0),
bootTime: testBootTime,
timezone: 'Australia/Melbourne',
);
final testOS = OperatingSystem(name: 'testOS');
Expand Down Expand Up @@ -78,7 +79,7 @@ void main() {
'free_storage': 1234567,
'external_storage_size': 98765,
'external_free_storage': 98765,
'boot_time': '1970-01-01T10:00:00.000',
'boot_time': testBootTime.toIso8601String(),
'timezone': 'Australia/Melbourne',
},
'os': {
Expand Down