From bb8353b0d97f6b9e147a6e971c430ceab40bd079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20P=C3=A9rez?= Date: Mon, 17 Feb 2025 09:24:45 +0100 Subject: [PATCH] refactor: add missing `mts` ext. support to checkly config --- .../cli/src/services/__tests__/checkly-config-loader.spec.ts | 2 +- packages/cli/src/services/checkly-config-loader.ts | 4 ++-- packages/create-cli/src/actions/playwright.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/services/__tests__/checkly-config-loader.spec.ts b/packages/cli/src/services/__tests__/checkly-config-loader.spec.ts index 57959a948..1c18b7219 100644 --- a/packages/cli/src/services/__tests__/checkly-config-loader.spec.ts +++ b/packages/cli/src/services/__tests__/checkly-config-loader.spec.ts @@ -23,7 +23,7 @@ describe('loadChecklyConfig()', () => { await loadChecklyConfig(configDir) } catch (e: any) { expect(e.message).toContain(`Unable to locate a config at ${configDir} with ${ - ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mjs'].join(', ')}.`) + ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mts', 'checkly.config.mjs'].join(', ')}.`) } }) it('config TS file should export an object', async () => { diff --git a/packages/cli/src/services/checkly-config-loader.ts b/packages/cli/src/services/checkly-config-loader.ts index 250a75980..4b269ddd3 100644 --- a/packages/cli/src/services/checkly-config-loader.ts +++ b/packages/cli/src/services/checkly-config-loader.ts @@ -101,7 +101,7 @@ function isString (obj: any) { } export function getChecklyConfigFile (): {checklyConfig: string, fileName: string} | undefined { - const filenames: string[] = ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mjs'] + const filenames: string[] = ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mts', 'checkly.config.mjs'] let config for (const configFile of filenames) { const dir = path.resolve(path.dirname(configFile)) @@ -120,7 +120,7 @@ export function getChecklyConfigFile (): {checklyConfig: string, fileName: strin return config } -export async function loadChecklyConfig (dir: string, filenames = ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mjs']): Promise<{ config: ChecklyConfig, constructs: Construct[] }> { +export async function loadChecklyConfig (dir: string, filenames = ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mts', 'checkly.config.mjs']): Promise<{ config: ChecklyConfig, constructs: Construct[] }> { let config Session.loadingChecklyConfigFile = true Session.checklyConfigFileConstructs = [] diff --git a/packages/create-cli/src/actions/playwright.ts b/packages/create-cli/src/actions/playwright.ts index 8e8ecd37c..469b127cc 100644 --- a/packages/create-cli/src/actions/playwright.ts +++ b/packages/create-cli/src/actions/playwright.ts @@ -45,7 +45,7 @@ function handleError (copySpinner: ora.Ora, message: string | unknown) { } function getChecklyConfigFile (): {checklyConfig: string, fileName: string} | undefined { - const filenames: string[] = ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mjs'] + const filenames: string[] = ['checkly.config.ts', 'checkly.config.js', 'checkly.config.mts', 'checkly.config.mjs'] let config for (const configFile of filenames) { const dir = path.resolve(path.dirname(configFile))