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

[Feature]: Show which project failed when a preset fails to load #15193

Closed
askoufis opened this issue Jul 17, 2024 · 3 comments · Fixed by #15194
Closed

[Feature]: Show which project failed when a preset fails to load #15193

askoufis opened this issue Jul 17, 2024 · 3 comments · Fixed by #15194

Comments

@askoufis
Copy link
Contributor

🚀 Feature Proposal

When a jest project with a preset fails to load that preset, the validation error shown should specify which project failed. Currently, no information is given as to which project failed.

Motivation

It will allow the user to quickly understand which project is the cause of the preset loading error.

Example

I have made a reproduction of the error here. When running pnpm test, the validation error Preset ./jest-preset.js not found is shown.

Both jest configs have the same preset defined, ./jest-preset.js. Clearly the relative path of the preset in scripts/jest.config.cjs is incorrect, however I would have no way of knowing this based on the error.

Pitch

To provide a better user experience when this error is encountered.

@askoufis askoufis changed the title [Feature]: Provide more information when a preset fails to load to aid debugging [Feature]: Show which project failed when a preset fails to load Jul 17, 2024
@SimenB
Copy link
Member

SimenB commented Jul 17, 2024

Happy to take a PR for this 👍 Code is here:

throw createConfigError(
` Preset ${chalk.bold(presetPath)} not found.`,
);

@SimenB
Copy link
Member

SimenB commented Aug 8, 2024

https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.6

Copy link

github-actions bot commented Sep 8, 2024

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 Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants