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

Q: Why warning: unable to locate custom jest configuration file? #1102

Open
snebjorn opened this issue Jan 20, 2022 · 3 comments
Open

Q: Why warning: unable to locate custom jest configuration file? #1102

snebjorn opened this issue Jan 20, 2022 · 3 comments

Comments

@snebjorn
Copy link

`warning: unable to locate custom jest configuration file at path "${jestConfigPath}"`

I was wondering why it's warning me that I don't have a jest.config.js in my project. Isn't it just as good to put the config inside angular.json or even have no config?

@just-jeb
Copy link
Owner

True, it is as good. The warning was aiming to solve this issue by increasing visibility for misplaced configs.
That said even back then I wasn't quite sure about the solution.
I guess it can be changed to an info instead of warning and just say that it is looking for a custom config at this path and falling back to default config because the config is not found.
Another option is some kind of verbose flag, although I'd like to keep the list of arguments to the builder as close as possible to the list of arguments of Jest.
Open to any suggestions.

@snebjorn
Copy link
Author

It could print what config files it found and use and perhaps list them in the override order.
So something like:

Found custom jest configuration: package.json (workspace root) -> jest.config.js (workspace root) -> angular.json ([your project]) -> path/to/jest.config.js

It would only list found configs. So if a workspace only had jest.config.js in the workspace root and in angular.json it would look like this:

Found custom jest configuration: jest.config.js (workspace root) -> angular.json ([your project])

This would make it very easy to figure out what configs were used and help debug configs :)

@just-jeb
Copy link
Owner

I like the idea. Don't know when I can get to it because there are some more important issues to deal with but it sounds simple enough, so if anyone wants to go ahead and come up with a PR, they're most welcome to do so 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants