From 26d6efc3520f10ba51fdd5a0a157caa8fc588256 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Mon, 2 Nov 2026 20:15:45 +0100 Subject: [PATCH] Add integration_test package. --- packages/integration_test/README.md | 23 +++++++++++++++++++ .../lib/integration_test.dart | 19 +++++++++++++++ packages/integration_test/pubspec.yaml | 11 +++++++++ pubspec.yaml | 1 + 4 files changed, 54 insertions(+) create mode 100644 packages/integration_test/README.md create mode 100644 packages/integration_test/lib/integration_test.dart create mode 100644 packages/integration_test/pubspec.yaml diff --git a/packages/integration_test/README.md b/packages/integration_test/README.md new file mode 100644 index 00000000..ab98b1d7 --- /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 00000000..53b2f3f7 --- /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 00000000..d0059fd6 --- /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 6fb659a5..27f240d6 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