-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test target to the app_that_uses_foo/ example (#6687)
* Add a test target to the app_that_uses_foo/ example * changelog
- Loading branch information
1 parent
d9b3aa8
commit 71e102c
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/devtools_extensions/example/app_that_uses_foo/test/app_that_uses_foo_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2023 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:app_that_uses_foo/main.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:foo/foo.dart'; | ||
|
||
// This test can be run to verify that the `package:foo` DevTools extension | ||
// loads properly when debugging a test target with DevTools. | ||
// | ||
// To test this, run the following command and copy the VM service URI to | ||
// connect to DevTools: | ||
// | ||
// flutter run test/app_that_uses_foo_test.dart --start-paused | ||
|
||
void main() { | ||
testWidgets('Builds $MyAppThatUsesFoo', (tester) async { | ||
await tester.pumpWidget(const MyAppThatUsesFoo()); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.byType(MyAppThatUsesFoo), findsOneWidget); | ||
expect(find.byType(FooWidget), findsOneWidget); | ||
}); | ||
} |