Skip to content
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

Merged
merged 2 commits into from
Feb 16, 2020

Conversation

the-spyke
Copy link
Contributor

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:

$ jest --config path/jest.config.cjs

It should successfully load the config.

@@ -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)$/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mjs as well 🙂

@drew-gross
Copy link

drew-gross commented Feb 16, 2020

Codecov Report

Merging #9578 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4a10f7...54bdaed. Read the comment docs.

@the-spyke the-spyke force-pushed the add-cjs-to-config-cli-option branch from 32665d8 to 54bdaed Compare February 16, 2020 08:59
Copy link
Member

@SimenB SimenB left a 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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call 👍

@codecov-io
Copy link

Codecov Report

Merging #9578 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/expect/src/utils.ts 96.22% <0%> (+1.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4a10f7...a5a75d2. Read the comment docs.

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants