From cfe2cdffa4ff5b68729084b6cd40e1b51b2003fc Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 24 Feb 2024 18:03:12 +0700 Subject: [PATCH 1/4] fix ts fail --- tests/e2e/utils/killApp.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/utils/killApp.ts b/tests/e2e/utils/killApp.ts index 889f345cf222..93a9d6d116cc 100644 --- a/tests/e2e/utils/killApp.ts +++ b/tests/e2e/utils/killApp.ts @@ -1,7 +1,9 @@ import config from '../config'; import execAsync from './execAsync'; -const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): Promise { +const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): Promise & { + abort?: () => void; +} { if (platform !== 'android') { throw new Error(`killApp() missing implementation for platform: ${platform}`); } From c4441f0cd488287ae0b3b2ce066cf4c7ba236b23 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 24 Feb 2024 18:04:20 +0700 Subject: [PATCH 2/4] fix ts fail --- tests/e2e/utils/killApp.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/e2e/utils/killApp.ts b/tests/e2e/utils/killApp.ts index 93a9d6d116cc..7e465e2fa2c3 100644 --- a/tests/e2e/utils/killApp.ts +++ b/tests/e2e/utils/killApp.ts @@ -1,9 +1,11 @@ import config from '../config'; import execAsync from './execAsync'; -const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): Promise & { +type PromiseWithAbort = Promise & { abort?: () => void; -} { +}; + +const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): PromiseWithAbort { if (platform !== 'android') { throw new Error(`killApp() missing implementation for platform: ${platform}`); } From b994ebb76205c854ea768633b2a8d1d7420410cb Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 24 Feb 2024 21:51:30 +0700 Subject: [PATCH 3/4] fix ts fail --- tests/e2e/utils/execAsync.ts | 2 ++ tests/e2e/utils/killApp.ts | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/e2e/utils/execAsync.ts b/tests/e2e/utils/execAsync.ts index 8f1a4ec10c6b..9ec8ca892a50 100644 --- a/tests/e2e/utils/execAsync.ts +++ b/tests/e2e/utils/execAsync.ts @@ -48,3 +48,5 @@ export default (command: string, env: NodeJS.ProcessEnv = {}): PromiseWithAbort return promise; }; + +export type {PromiseWithAbort}; diff --git a/tests/e2e/utils/killApp.ts b/tests/e2e/utils/killApp.ts index 7e465e2fa2c3..5e61652580de 100644 --- a/tests/e2e/utils/killApp.ts +++ b/tests/e2e/utils/killApp.ts @@ -1,9 +1,5 @@ import config from '../config'; -import execAsync from './execAsync'; - -type PromiseWithAbort = Promise & { - abort?: () => void; -}; +import execAsync, {PromiseWithAbort} from './execAsync'; const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): PromiseWithAbort { if (platform !== 'android') { From 828113f2871bae80e68439aff5f417cd0253e8c1 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 24 Feb 2024 21:59:01 +0700 Subject: [PATCH 4/4] import type --- tests/e2e/utils/killApp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/utils/killApp.ts b/tests/e2e/utils/killApp.ts index 5e61652580de..f2d7bb56112f 100644 --- a/tests/e2e/utils/killApp.ts +++ b/tests/e2e/utils/killApp.ts @@ -1,5 +1,6 @@ import config from '../config'; -import execAsync, {PromiseWithAbort} from './execAsync'; +import execAsync from './execAsync'; +import type {PromiseWithAbort} from './execAsync'; const killApp = function (platform = 'android', packageName = config.MAIN_APP_PACKAGE): PromiseWithAbort { if (platform !== 'android') {