feat: enable flavor option on test command (#89045)

This commit is contained in:
Core
2021-11-12 00:23:02 +07:00
committed by GitHub
parent 240973283d
commit d8034538bd
8 changed files with 89 additions and 4 deletions

View File

@@ -73,6 +73,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
usesDartDefineOption();
usesWebRendererOption();
usesDeviceUserOption();
usesFlavorOption();
argParser
..addMultiOption('name',

View File

@@ -605,6 +605,32 @@ dev_dependencies:
]),
});
testUsingContext('Integration tests given flavor', () async {
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
final TestCommand testCommand = TestCommand(testRunner: testRunner);
final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand);
await commandRunner.run(const <String>[
'test',
'--no-pub',
'--flavor',
'dev',
'integration_test',
]);
expect(
testRunner.lastDebuggingOptionsValue.buildInfo.flavor,
contains('dev'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => _FakeDeviceManager(<Device>[
FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android),
]),
});
testUsingContext('Builds the asset manifest by default', () async {
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);