Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xinthink committed Apr 3, 2020
1 parent 2bf0934 commit 714ecd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/ios_delegate_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:math';

import 'package:flt_worker/flt_worker.dart';
import 'package:flt_worker/ios.dart';
import 'package:flt_worker/src/background_tasks/delegate.dart';
Expand Down Expand Up @@ -37,8 +39,9 @@ void main() {
),
);
var req = parseWorkIntent(intent) as BGProcessingTaskRequest;
expect(req.earliestBeginDate.millisecondsSinceEpoch / 1000,
now.add(Duration(minutes: 11)).millisecondsSinceEpoch / 1000);
expect(
(req.earliestBeginDate.millisecondsSinceEpoch - now.add(Duration(minutes: 11)).millisecondsSinceEpoch).abs(),
lessThanOrEqualTo(1000));
expect(req.requiresNetworkConnectivity, isTrue);
expect(req.requiresExternalPower, isTrue);

Expand Down

0 comments on commit 714ecd0

Please sign in to comment.