-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): .cjs files support by "--config" option #9578
Conversation
packages/jest-cli/src/cli/args.ts
Outdated
@@ -52,10 +52,10 @@ export const check = (argv: Config.Argv) => { | |||
if ( | |||
argv.config && | |||
!isJSONString(argv.config) && | |||
!argv.config.match(/\.js(on)?$/) | |||
!argv.config.match(/\.(js|cjs|json)$/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mjs
as well 🙂
Codecov Report
@@ Coverage Diff @@
## master #9578 +/- ##
=======================================
Coverage 65.07% 65.07%
=======================================
Files 286 286
Lines 12144 12144
Branches 3010 3010
=======================================
Hits 7903 7903
Misses 3605 3605
Partials 636 636 Continue to review full report at Codecov.
|
32665d8
to
54bdaed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonderful, thanks!
!argv.config.match(/\.js(on)?$/) | ||
!argv.config.match( | ||
new RegExp( | ||
`\\.(${constants.JEST_CONFIG_EXT_ORDER.map(e => e.substring(1)).join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call 👍
Codecov Report
@@ Coverage Diff @@
## master #9578 +/- ##
==========================================
+ Coverage 65.07% 65.09% +0.01%
==========================================
Files 286 286
Lines 12144 12144
Branches 3010 3010
==========================================
+ Hits 7903 7905 +2
+ Misses 3605 3604 -1
+ Partials 636 635 -1
Continue to review full report at Codecov.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes
.cjs
file validation for CLI--config
option. Jest supports such files already, but CLI args validation wasn't updated (#9086).Test plan
Try to run jest by specifying a
.cjs
config manually:It should successfully load the config.