Skip to content

Commit 09eef92

Browse files
authored
fix: allow jest.config.mjs and jest.config.cjs jest config files (#314)
1 parent 4077ccd commit 09eef92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/test-runner.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ function getJestArgs(argv) {
5959
}
6060

6161
// Provide default configuration when none is present at the project root.
62-
const hasCustomConfig = fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.js'));
62+
const hasCustomConfig =
63+
fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.js')) ||
64+
fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.mjs')) ||
65+
fs.existsSync(path.resolve(PROJECT_ROOT, 'jest.config.cjs'));
6366
if (!hasCustomConfig) {
6467
jestArgs.unshift(`--config=${JSON.stringify(jestConfig)}`);
6568
}

0 commit comments

Comments
 (0)