// Provide default configuration when none is present at the project root.
const hasCustomConfig = fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.js'))
|| fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.mjs'))
|| fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.cjs'));
Description
Currently
sfdx-lwc-jest
checks only for ajest.config.js
file, but jest supportsjest.config.js|ts|mjs|cjs|json
(reference).Steps to Reproduce
jest.config.cjs
filesfdx-lwc-jest
jest.config.cjs
or
jest.config.mjs
Expected Results
Allow
sfdx-lwc-jest
to use.cjs
and.mjs
jest config extensions.Actual Results
jest.config.cjs
andjest.config.mjs
config files are ignoredVersion
Possible Solution
Check for
.mjs
and.cjs
jest config files herehttps://github.com/salesforce/sfdx-lwc-jest/blob/bbdcfb1e5a5625108b9fb31550fad3f818ed4fc7/src/utils/test-runner.js#L62