Commit d15a3612 authored by TruongSinh Tran-Nguyen's avatar TruongSinh Tran-Nguyen Committed by Zachary Anderson

`flutter create --template=plugin` now include flutter unit test (#26456)

parent cb2ac0a1
......@@ -11,6 +11,10 @@ dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
......
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:{{projectName}}/{{projectName}}.dart';
void main() {
const MethodChannel channel = MethodChannel('{{projectName}}');
setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
return '42';
});
});
tearDown(() {
channel.setMockMethodCallHandler(null);
});
test('getPlatformVersion', () async {
expect(await {{pluginDartClass}}.platformVersion, '42');
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment