Add support for jh/jest.config.js

This commit is contained in:
Paul Slaughter 2021-11-09 09:29:43 -06:00
parent 28cf5c88d9
commit 2fa3c81a89
No known key found for this signature in database
GPG key ID: DF5690803C68282A

View file

@ -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'),
};
}