Skip to content

Commit

Permalink
fix: allow jest.config.mjs and jest.config.cjs jest config files (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lukethacoder authored May 4, 2023
1 parent 4077ccd commit 09eef92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ function getJestArgs(argv) {
}

// Provide default configuration when none is present at the project root.
const hasCustomConfig = fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.js'));
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'));
if (!hasCustomConfig) {
jestArgs.unshift(`--config=${JSON.stringify(jestConfig)}`);
}
Expand Down

0 comments on commit 09eef92

Please sign in to comment.