Skip to content

Instantly share code, notes, and snippets.

@enriquesaid
Last active May 27, 2020 14:21
Show Gist options
  • Save enriquesaid/016348c4061d5bee9f5daad532524d5b to your computer and use it in GitHub Desktop.
Save enriquesaid/016348c4061d5bee9f5daad532524d5b to your computer and use it in GitHub Desktop.
flutter main file test
import 'package:flutter_app/main.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
class FakeFunctions {
void runApp(dynamic widget) {}
}
class FunctionsMock extends Mock implements FakeFunctions {}
void main() {
test('App bootstrap method', () async {
var functionMock = FunctionsMock();
var app = App();
await app.bootstrap(functionMock.runApp);
verify(functionMock.runApp(any));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment