-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow jest.config.cts #14070
Allow jest.config.cts #14070
Conversation
Good idea. These are the missing parts:
|
@mrazauskas Thanks for the hints, I added some things now, please tell me if something is missing 🙂 |
Thanks! Did you try running these new e2e tests? To do so, you build the repo and run |
Interesting, I ran |
I investigated the failing tests and was able to recognize two separate issues:
I then tried to move it to the back using I don't have any idea how to solve this... |
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Still trying, but still really have no idea how to fix the issue that the |
@DerTimonius can you post a new short summary about what the problem is? From the error message and your conclusions above, it seems like the tests are not running Maybe @mrazauskas can assist...? |
One thing that I can see without looking too deeply into it is that you have an Since jest/packages/jest-cli/src/init/__tests__/__fixtures__/has-jest-config-file-cjs/jest.config.cjs Lines 1 to 8 in cddd949
|
Ah no, I'm wrong about that, |
@karlhorky Sure. The issues I'm currently facing are solely in the new integration tests that were necessary to write. Initially I got an error, telling me that I can't use
It appears to me that the normal TypeScript code is not recognized as such - if I change the code to this: const config = {displayName: 'ts-object-config', verbose: true} as Config.InitialOptions I get almost a different error, telling me that What I tried so far
|
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Hiya, sorry about the radio silence. Let's get this in 🙂 I tried to merge in |
Hi @SimenB |
Still getting the same errors that I mentioned above (#14070 (comment)) I really don't get this error: writing TS code in a .cts file and it's not recognized... |
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
@@ -26,7 +27,7 @@ import { | |||
export default async function readConfigFileAndSetRootDir( | |||
configPath: string, | |||
): Promise<Config.InitialOptions> { | |||
const isTS = configPath.endsWith(JEST_CONFIG_EXT_TS); | |||
const isTS = configPath.endsWith(JEST_CONFIG_EXT_TS || JEST_CONFIG_EXT_CTS); |
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.
const isTS = configPath.endsWith(JEST_CONFIG_EXT_TS || JEST_CONFIG_EXT_CTS); | |
const isTS = | |
configPath.endsWith(JEST_CONFIG_EXT_TS) || | |
configPath.endsWith(JEST_CONFIG_EXT_CTS); |
@DerTimonius I think this is your issue - cts
was never considered
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.
oh man. you're right 🙈
implemented this change with the last commit and fixed the tests (all running locally! they did not before, so this is a huge improvement)
nice! seems like we just need to fix |
Hm, I don't know why the last check is failing. I did not remove the file in question: |
|
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.
thanks!
@SimenB @DerTimonius thanks for the PR, review and merge! Look forward to trying this out in a release! Will this be a part of |
@SimenB if the next minor or major releases are still going to be pending for a while, what do you think of creating and publishing a new alpha release eg. |
Nice, this has been released in |
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
This PR will allow loading
jest.config.cts
files for ESM projects like proposed in PR #14064 and issue #13118Additionally, this PR will add fixtures and snapshots that should fix the tests.
Closes #14064
Test plan