Skip to content

Commit acc5271

Browse files
committed
Fix tests.
1 parent 354589b commit acc5271

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pkgs/dart_mcp_server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,6 @@ For more information, see the official VS Code documentation for
160160
| `run_tests` | Run tests | Run Dart or Flutter tests with an agent centric UX. ALWAYS use instead of `dart test` or `flutter test` shell commands. |
161161
| `set_widget_selection_mode` | Set Widget Selection Mode | Enables or disables widget selection mode in the active Flutter application. Requires "connect_dart_tooling_daemon" to be successfully called first. This is not necessary when using flutter driver, only use it when you want the user to select a widget. |
162162
| `signature_help` | Signature help | Get signature help for an API being used at a given cursor position in a file. |
163-
| `stop_app` | | Kills a running Flutter process started by the launch_app tool. |
163+
| `stop_app` | | Stops a running Flutter process started by the launch_app tool. |
164164

165165
<!-- generated -->

pkgs/dart_mcp_server/test/tools/flutter_launcher_test.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void main() {
318318
'test-device',
319319
],
320320
stderr: 'Something went wrong',
321-
exitCode: Future.value(1),
321+
exitCode: 1,
322322
),
323323
);
324324
final serverAndClient = await createServerAndClient(
@@ -697,7 +697,7 @@ class Command {
697697
final List<String> command;
698698
final String? stdout;
699699
final String? stderr;
700-
final Future<int>? exitCode;
700+
final int? exitCode;
701701
final int pid;
702702

703703
Command(
@@ -754,7 +754,9 @@ class MockProcessManager implements ProcessManager {
754754
stdout: Stream.value(utf8.encode(mockCommand.stdout ?? '')),
755755
stderr: Stream.value(utf8.encode(mockCommand.stderr ?? '')),
756756
pid: pid,
757-
exitCodeFuture: mockCommand.exitCode,
757+
exitCodeFuture: mockCommand.exitCode != null
758+
? Future(() => mockCommand.exitCode!)
759+
: null,
758760
);
759761
runningProcesses[pid] = process;
760762
return process;
@@ -781,7 +783,7 @@ class MockProcessManager implements ProcessManager {
781783
final mockCommand = _findCommand(command);
782784
return ProcessResult(
783785
mockCommand.pid,
784-
await (mockCommand.exitCode ?? Future.value(0)),
786+
mockCommand.exitCode ?? 0,
785787
mockCommand.stdout ?? '',
786788
mockCommand.stderr ?? '',
787789
);
@@ -804,7 +806,7 @@ class MockProcessManager implements ProcessManager {
804806
final mockCommand = _findCommand(command);
805807
return ProcessResult(
806808
mockCommand.pid,
807-
0,
809+
mockCommand.exitCode ?? 0,
808810
mockCommand.stdout ?? '',
809811
mockCommand.stderr ?? '',
810812
);

0 commit comments

Comments
 (0)