From 2fa3c81a893463ecb296f7edca72f61dd0caa68e Mon Sep 17 00:00:00 2001 From: Paul Slaughter Date: Tue, 9 Nov 2021 09:29:43 -0600 Subject: [PATCH] Add support for jh/jest.config.js --- jest.config.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index 4d9e19abbafc..00c28dad0e11 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,13 @@ +const fs = require('fs'); +const IS_JH = require('./config/helpers/is_jh_env'); const baseConfig = require('./jest.config.base'); -module.exports = { - ...baseConfig('spec/frontend'), -}; +// TODO: Remove existsSync once jh has added jest.config.js +if (IS_JH && fs.existsSync('./jh/jest.config.js')) { + // eslint-disable-next-line global-require, import/no-unresolved + module.exports = require('./jh/jest.config'); +} else { + module.exports = { + ...baseConfig('spec/frontend'), + }; +}