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

[Bug]: ts-jest[cli] (FATAL) Configuration file jest.config.cjs must be a JavaScript or JSON file. with config.migrate in vite react project #4485

Open
Amy-B-Tradition opened this issue Jul 30, 2024 · 2 comments
Labels
🐛 Bug Confirmed Bug is confirmed

Comments

@Amy-B-Tradition
Copy link

Version

^29.1.1

Steps to reproduce

I'm in the middle of a Parcel 1 > Vite upgrade.
After getting my tests running again, I got the following message:
ts-jest[backports] (WARN) Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate <config-file>.

So I entered
ts-jest config:migrate jest.config.cjs
(File extension change was needed because type: "module" was added to package.json for vite).

Expected behavior

Some sort of upgrade wizard or something?

Actual behavior

ts-jest[cli] (FATAL) Configuration file jest.config.cjs must be a JavaScript or JSON file.

Debug log

None

Additional context

No response

Environment

Need to install the following packages:
[email protected]
Ok to proceed? (y)
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 1, 2024

The CLI migrate command does migration automatically. What kind of wizard would you suggest?

@Amy-B-Tradition
Copy link
Author

I would suggest that the migration should happen when the jest.config file has a cjs extension, since you need that with vite and it's a valid extension for a jest.config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Confirmed Bug is confirmed
Projects
None yet
Development

No branches or pull requests

2 participants