Add mirror overrides to doctor output (#56928)

This commit is contained in:
Jenn Magder
2020-05-11 11:57:02 -07:00
committed by GitHub
parent 9c87b32477
commit 4ecb1bbe2d
3 changed files with 27 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ import '../../src/testbed.dart';
final Generator _kNoColorOutputPlatform = () => FakePlatform(
localeName: 'en_US.UTF-8',
environment: <String, String>{},
stdoutSupportsAnsi: false,
);
@@ -588,6 +589,24 @@ void main() {
Platform: _kNoColorOutputPlatform,
FlutterVersion: () => mockFlutterVersion,
});
testUsingContext('shows mirrors', () async {
(globals.platform as FakePlatform).environment = <String, String>{
'PUB_HOSTED_URL': 'https://example.com/pub',
'FLUTTER_STORAGE_BASE_URL': 'https://example.com/flutter',
};
expect(await FlutterValidatorDoctor(logger).diagnose(verbose: true), isTrue);
expect(logger.statusText, contains('Pub download mirror https://example.com/pub'));
expect(logger.statusText, contains('Flutter download mirror https://example.com/flutter'));
}, overrides: <Type, Generator>{
Artifacts: () => mockArtifacts,
FileSystem: () => memoryFileSystem,
OutputPreferences: () => OutputPreferences(wrapText: false),
ProcessManager: () => mockProcessManager,
Platform: _kNoColorOutputPlatform,
FlutterVersion: () => mockFlutterVersion,
});
});
testUsingContext('validate non-verbose output wrapping', () async {