Skip to content

Commit

Permalink
ref(aws): make apkPath also optional
Browse files Browse the repository at this point in the history
Using TS would be a better option
  • Loading branch information
Almouro committed Oct 21, 2022
1 parent 8680bbb commit 4e747d6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/aws-device-farm/src/commands/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const runTest = async ({
testFile,
}: {
projectName?: string;
apkPath: string;
apkPath?: string;
testSpecsPath?: string;
testFolder?: string;
testName?: string;
Expand All @@ -84,13 +84,19 @@ export const runTest = async ({
});
}

const apkUploadArn =
apkUploadArnGiven ||
(await uploadRepository.upload({
let apkUploadArn;

if (apkUploadArnGiven) {
apkUploadArn = apkUploadArnGiven;
} else if (apkPath) {
apkUploadArn = await uploadRepository.upload({
projectArn,
filePath: apkPath,
type: UploadType.ANDROID_APP,
}));
});
} else {
throw new Error("Neither apkUploadArn nor apkPath was passed.");
}

const newTestSpecPath = createTestSpecFile({
testSpecsPath,
Expand Down

0 comments on commit 4e747d6

Please sign in to comment.