Q: Why `warning: unable to locate custom jest configuration file`?
https://github.com/just-jeb/angular-builders/blob/aa088a500f40cd802a24840264d6e58e866aa489/packages/jest/src/custom-config.resolver.ts#L24
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?
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.
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 :)
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 😉