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

moduleFileExtensions must include 'js' #7736

Closed
Ky6uk opened this issue Jan 28, 2019 · 7 comments · Fixed by #7751
Closed

moduleFileExtensions must include 'js' #7736

Ky6uk opened this issue Jan 28, 2019 · 7 comments · Fixed by #7751
Labels

Comments

@Ky6uk
Copy link

Ky6uk commented Jan 28, 2019

🐛 Bug Report

After an upgrade to v24.0.0 I got an error moduleFileExtensions must include 'js' even though a project in projects array should get only ts files (ex: jest-runner-tslint).

Expected behavior

moduleFileExtensions can contain only exact extensions if the extension js not using at all.

Run npx envinfo --preset jest --markdown

System:

  • OS: macOS 10.14.2
  • CPU: (4) x64 Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz

Binaries:

  • Node: 11.7.0 - /usr/local/bin/node
  • Yarn: 1.13.0 - /usr/local/bin/yarn
  • npm: 6.5.0 - /usr/local/bin/npm

npmPackages:

  • jest: 24.0.0 => 24.0.0
@Ky6uk Ky6uk added the 🐛 Bug label Jan 28, 2019
@jeysal
Copy link
Contributor

jeysal commented Jan 28, 2019

Confirmed. For use cases like running TSLint, Jest does not internally need .js, so disallowing it was an undocumented breaking change.

@jeysal
Copy link
Contributor

jeysal commented Jan 28, 2019

Breaking change: #7160

@SimenB
Copy link
Member

SimenB commented Jan 28, 2019

I guess we can check if the runner is jest-runner and only require .js if it is

@jeysal
Copy link
Contributor

jeysal commented Jan 28, 2019

Is there a reason why jest-runner can't do this check itself?

@SimenB
Copy link
Member

SimenB commented Jan 28, 2019

We wanna have valid config come out of normalize and never mutate it. I suppose we can throw in there, but it's weird to throw a config error outside of the config module

@jeysal
Copy link
Contributor

jeysal commented Jan 28, 2019

I mean, it's generally valid config, it's just that jest-runner doesn't like it - an external runner would have to complain on its own as well. Alternative would be to let runners declare their mandatory extension, but that seems ridiculously overkill 😅
I'll try moving the check into jest-runner when I have some time :)

@github-actions
Copy link

This issue 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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants