diff --git a/packages/integration_test/README.md b/packages/integration_test/README.md new file mode 100644 index 0000000..ab98b1d --- /dev/null +++ b/packages/integration_test/README.md @@ -0,0 +1,23 @@ +# integration_test + +Runs integration tests on a device with +`flutter test integration_test -d `. Contains the bare minimum the +tool requires; tests are written with `package:test`. + +```yaml +dev_dependencies: + integration_test: + sdk: flutter + test: any +``` + +```dart +// integration_test/app_test.dart +import 'package:test/test.dart'; + +void main() { + test('runs in the app', () { + expect(1 + 1, 2); + }); +} +``` diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart new file mode 100644 index 0000000..53b2f3f --- /dev/null +++ b/packages/integration_test/lib/integration_test.dart @@ -0,0 +1,19 @@ +/// The bare minimum `flutter test integration_test` requires; the generated +/// test bootstrap calls the members below. +library; + +/// Called by the test bootstrap; does nothing. +class IntegrationTestWidgetsFlutterBinding { + IntegrationTestWidgetsFlutterBinding._(); + + static final _instance = IntegrationTestWidgetsFlutterBinding._(); + + /// Returns the binding. + static IntegrationTestWidgetsFlutterBinding ensureInitialized() => _instance; +} + +/// Called by the test bootstrap; does nothing. +abstract final class VmServiceProxyGoldenFileComparator { + /// Does nothing. + static void useIfRunningOnDevice() {} +} diff --git a/packages/integration_test/pubspec.yaml b/packages/integration_test/pubspec.yaml new file mode 100644 index 0000000..d0059fd --- /dev/null +++ b/packages/integration_test/pubspec.yaml @@ -0,0 +1,11 @@ +name: integration_test +description: >- + Runs integration tests on a device with `flutter test integration_test`. + A minimal version of Flutter's package:integration_test. +version: 0.0.1 +publish_to: none + +resolution: workspace + +environment: + sdk: ^3.11.0-169.0.dev diff --git a/pubspec.yaml b/pubspec.yaml index 6fb659a..27f240d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,6 +5,7 @@ environment: workspace: - examples/hello_world + - packages/integration_test dependencies: _discoveryapis_commons: 1.0.7