I have jest 27 installed, and I see that sometimes I get pretty error messages like this (with visual pointer to the failing line):

And sometimes it prints the errors like this (plain error, without pointer):

I am trying to understand why it happens, can someone help me with that?
CodePudding user response:
Ok, after doing some investigations, it seems like the difference is if the error happens in node_modules or not. If the error is thrown within the project's root, jest will print a pretty message with a pointer to the line that caused the error. But if the error happens from within the node_modules folder, Jest will print the error message along with the stack trace, without any visual pointers.
