Closed DMartens closed 3 months ago
Example for a too big serialized error:
Vitest prints error properties only in verbose
reporter. If you don't like it, do not use verbose
reporter.
I am not using the verbose
reporter but a custom reporter which uses this.ctx.logger.printError
directly and cannot set "printProperties" (it is also not in its types). It seems it is not the same printError as defined here.
My concrete example is that eslint
adds the current traversed AST node to the error which then get serialized:
I am not using the
verbose
reporter but a custom reporter which usesthis.ctx.logger.printError
directly and cannot set "printProperties" (it is also not in its types)
You need to set verbose: false
if you are using printError
in the logger:
Describe the bug
Some assertion messages are too long, e.g. any assertion with an unhandled error which has a big object as its property which then gets serialized. Here the error should be shortened by giving each property a maximum string length.
The problem is the other way around for assertions with a
.resolves
modifier which assertion message only includes the error message (which may be shortened) . In this case it would be more helpful if the whole error gets serialized. There may be others but these two cases crop up regularly.Reproduction
Example for messages getting cut off for
.resolves
:Example for a too big serialized error:
System Info
Used Package Manager
pnpm
Validations