feat: enable flavor option on test command (#89045)
This commit is contained in:
@@ -73,6 +73,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
|
||||
usesDartDefineOption();
|
||||
usesWebRendererOption();
|
||||
usesDeviceUserOption();
|
||||
usesFlavorOption();
|
||||
|
||||
argParser
|
||||
..addMultiOption('name',
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user