2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00
inventree-app/test/setup.dart
Oliver 21ace1ae02
Package updates (#365)
* Update dart version

* Update flutter version in workflow

* Update packages

* Updates to android workflow

* Specify dart verrsion in CI

* Run flutter upgrade

* Helps to check which workflow is actually running I guess

* Disable linting check

* linting fixes

* linting

* Bug fix for paginator
2023-06-12 22:52:07 +10:00

22 lines
710 B
Dart

import "package:flutter/services.dart";
import "package:flutter_test/flutter_test.dart";
// This is the same as the following issue except it keeps the http client
// TestWidgetsFlutterBinding.ensureInitialized();
class CustomBinding extends AutomatedTestWidgetsFlutterBinding {
@override
bool get overrideHttpClient => false;
}
void setupTestEnv() {
// Uses custom binding to not override the http client
CustomBinding();
// Mock the path provider
const MethodChannel channel = MethodChannel("plugins.flutter.io/path_provider");
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
return ".";
});
}