Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
d15a3612
Commit
d15a3612
authored
Feb 12, 2019
by
TruongSinh Tran-Nguyen
Committed by
Zachary Anderson
Feb 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`flutter create --template=plugin` now include flutter unit test (#26456)
parent
cb2ac0a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
pubspec.yaml.tmpl
packages/flutter_tools/templates/plugin/pubspec.yaml.tmpl
+4
-0
projectName_test.dart.tmpl
...er_tools/templates/plugin/test/projectName_test.dart.tmpl
+21
-0
No files found.
packages/flutter_tools/templates/plugin/pubspec.yaml.tmpl
View file @
d15a3612
...
...
@@ -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
...
...
packages/flutter_tools/templates/plugin/test/projectName_test.dart.tmpl
0 → 100644
View file @
d15a3612
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');
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment