From 565ff7cd5bf7ee605303af824fdc3ea0eac594c1 Mon Sep 17 00:00:00 2001 From: Blazej Kustra <blazej.kustra@swmansion.com> Date: Tue, 20 Feb 2024 15:52:58 +0100 Subject: [PATCH 1/2] [TS migration] Migrate 'androidReversePort.js' test to TypeScript --- .../utils/{androidReversePort.js => androidReversePort.ts} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename tests/e2e/utils/{androidReversePort.js => androidReversePort.ts} (65%) diff --git a/tests/e2e/utils/androidReversePort.js b/tests/e2e/utils/androidReversePort.ts similarity index 65% rename from tests/e2e/utils/androidReversePort.js rename to tests/e2e/utils/androidReversePort.ts index 55851daf59bf..23dcdf402426 100644 --- a/tests/e2e/utils/androidReversePort.js +++ b/tests/e2e/utils/androidReversePort.ts @@ -1,6 +1,8 @@ import config from '../config'; import execAsync from './execAsync'; -export default function () { +function androidReversePort(): Promise<void> { return execAsync(`adb reverse tcp:${config.SERVER_PORT} tcp:${config.SERVER_PORT}`); } + +export default androidReversePort; From 2b35713636ac9c56122a9e01894c40513bee16d3 Mon Sep 17 00:00:00 2001 From: Blazej Kustra <blazej.kustra@swmansion.com> Date: Mon, 26 Feb 2024 10:01:44 +0100 Subject: [PATCH 2/2] Use PromiseWithAbort type --- tests/e2e/utils/androidReversePort.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/utils/androidReversePort.ts b/tests/e2e/utils/androidReversePort.ts index 23dcdf402426..acbb5a0757b3 100644 --- a/tests/e2e/utils/androidReversePort.ts +++ b/tests/e2e/utils/androidReversePort.ts @@ -1,7 +1,8 @@ import config from '../config'; +import type {PromiseWithAbort} from './execAsync'; import execAsync from './execAsync'; -function androidReversePort(): Promise<void> { +function androidReversePort(): PromiseWithAbort { return execAsync(`adb reverse tcp:${config.SERVER_PORT} tcp:${config.SERVER_PORT}`); }