Always show diagnostics (#57532)

This commit is contained in:
Jenn Magder
2020-05-19 18:17:03 -07:00
committed by GitHub
parent 67b0dbb40d
commit adead099a6
2 changed files with 51 additions and 23 deletions

View File

@@ -84,6 +84,25 @@ void main() {
DeviceManager: () => _FakeDeviceManager(),
ProcessManager: () => MockProcessManager(),
});
testUsingContext('available devices and diagnostics', () async {
final DevicesCommand command = DevicesCommand();
await createTestCommandRunner(command).run(<String>['devices']);
expect(
testLogger.statusText,
'''
2 connected devices:
ephemeral • ephemeral • android-arm • Test SDK (1.2.3) (emulator)
webby • webby • web-javascript • Web SDK (1.2.4) (emulator)
• Cannot connect to device ABC
'''
);
}, overrides: <Type, Generator>{
DeviceManager: () => _FakeDeviceManager(),
ProcessManager: () => MockProcessManager(),
});
});
}
@@ -126,4 +145,8 @@ class _FakeDeviceManager extends DeviceManager {
Future<List<Device>> refreshAllConnectedDevices({Duration timeout}) =>
getAllConnectedDevices();
@override
Future<List<String>> getDeviceDiagnostics() => Future<List<String>>.value(
<String>['Cannot connect to device ABC']
);
}