Skip to content

Commit

Permalink
[test] mock flutter_timezone method channel
Browse files Browse the repository at this point in the history
  • Loading branch information
dreautall committed Feb 24, 2024
1 parent 5b611de commit dafb8d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/auth_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:convert';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding;
import 'package:http/http.dart' as http;
import 'package:mockito/annotations.dart';
Expand Down Expand Up @@ -47,6 +48,13 @@ class MockCallbackFunction extends Mock {

void main() {
TestWidgetsFlutterBinding.ensureInitialized();
TestWidgetsFlutterBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('flutter_timezone'),
(MethodCall methodCall) async {
return "Europe/Berlin";
},
);

group("AuthError", () {
test("AuthErrorHost", () {
Expand Down

0 comments on commit dafb8d8

Please sign in to comment.