fix(shorebird_cli): ensure flutter artifacts are installed in shorebird preview (#1812)

This commit is contained in:
Bryan Oltman
2024-03-22 14:06:37 -04:00
committed by GitHub
parent 13de860a22
commit e15958419c
2 changed files with 8 additions and 0 deletions
@@ -304,6 +304,8 @@ class PreviewCommand extends ShorebirdCommand {
required DeploymentTrack track,
String? deviceId,
}) async {
await iosDeploy.installIfNeeded();
const platform = ReleasePlatform.ios;
final runnerDirectory = Directory(
getArtifactPath(
@@ -976,6 +976,7 @@ channel: ${track.channel}
device: any(named: 'device'),
),
).thenAnswer((_) async => ExitCode.success.code);
when(() => iosDeploy.installIfNeeded()).thenAnswer((_) async {});
when(
() => iosDeploy.installAndLaunchApp(
bundlePath: any(named: 'bundlePath'),
@@ -1002,6 +1003,11 @@ channel: ${track.channel}
..createSync(recursive: true)
..writeAsStringSync('app_id: $appId', flush: true);
test('ensures ios-deploy is installed', () async {
await runWithOverrides(command.run);
verify(() => iosDeploy.installIfNeeded()).called(1);
});
test('exits with code 70 when querying for release artifact fails',
() async {
final exception = Exception('oops');