From bfa0c586b6afa7c58440b6e6f7eaa8b44f6457e5 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Wed, 28 Feb 2024 15:34:20 +0100 Subject: [PATCH] ref: migrate e2e/config to TS --- src/libs/E2E/types.ts | 5 ++++- tests/e2e/{config.js => config.ts} | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) rename tests/e2e/{config.js => config.ts} (92%) diff --git a/src/libs/E2E/types.ts b/src/libs/E2E/types.ts index 2d48813fa115..89cbe1b6f417 100644 --- a/src/libs/E2E/types.ts +++ b/src/libs/E2E/types.ts @@ -1,3 +1,6 @@ +import type {TEST_NAMES} from 'tests/e2e/config'; +import type {ValueOf} from 'type-fest'; + type SigninParams = { email?: string; }; @@ -19,7 +22,7 @@ type NetworkCacheMap = Record< >; type TestConfig = { - name: string; + name: ValueOf; [key: string]: string; }; diff --git a/tests/e2e/config.js b/tests/e2e/config.ts similarity index 92% rename from tests/e2e/config.js rename to tests/e2e/config.ts index a7447a29c954..5ac03e489a52 100644 --- a/tests/e2e/config.js +++ b/tests/e2e/config.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- if the first value is '' nullish coalescing will return '' so leaving || for safty const OUTPUT_DIR = process.env.WORKING_DIRECTORY || './tests/e2e/results'; // add your test name here … @@ -17,7 +18,7 @@ const TEST_NAMES = { * npm run test:e2e -- --config ./path/to/your/config.js * ``` */ -module.exports = { +const config = { MAIN_APP_PACKAGE: 'com.expensify.chat.e2e', DELTA_APP_PACKAGE: 'com.expensify.chat.e2edelta', @@ -87,3 +88,7 @@ module.exports = { }, }, }; + +export default config; + +export {TEST_NAMES};