From eac2d9a4d55bfb59a17f64312917c407477b12d6 Mon Sep 17 00:00:00 2001 From: Daniel Choudhury Date: Thu, 28 Jul 2022 15:54:18 +0100 Subject: [PATCH] fix(cli): Modify existence check of jest.config to check for both .js and .ts extensions in rw test --- packages/cli/src/commands/testHandler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/testHandler.js b/packages/cli/src/commands/testHandler.js index 548fdde17e26..c044e40e14dd 100644 --- a/packages/cli/src/commands/testHandler.js +++ b/packages/cli/src/commands/testHandler.js @@ -33,7 +33,11 @@ function isJestConfigFile(sides) { for (let side of sides) { try { if (sides.includes(side)) { - if (!fs.existsSync(path.join(side, 'jest.config.js'))) { + const jestConfigExists = + fs.existsSync(path.join(side, 'jest.config.js')) || + fs.existsSync(path.join(side, 'jest.config.ts')) + + if (!jestConfigExists) { console.error( c.error( `\nError: Missing Jest config file ${side}/jest.config.js` +