Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/e2e/utils/killApp.js → tests/e2e/utils/killApp.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import config from '../config';
import execAsync from './execAsync';

export default function (platform = 'android', packageName = config.APP_PACKAGE) {
const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): Promise<void> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruben-rebelo Should we add type for param here

platform: string = 'android', packageName: string = config.APP_PACKAGE

cc @blazejkustra

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more note here, in this PR we remove APP_PACKAGE and add MAIN_APP_PACKAGE. But we miss to update here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DylanDylann I don't think so, if you add the type even lint complains about Type trivially inferred as we are directly assigning a string to the param.
Regarding the APP_PACKAGE part I've noticed that and I've changed it to MAIN_APP_PACKAGE.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. But It doesn't relate to this PR so I give a note for more clear

if (platform !== 'android') {
throw new Error(`killApp() missing implementation for platform: ${platform}`);
}

// Use adb to kill the app
return execAsync(`adb shell am force-stop ${packageName}`);
}
};

export default killApp;