cli
cli copied to clipboard
Add better error messages
What happened?
I used onlyAudits: ['csp-xss'] in the lighthouse config object and run nx code-pushup -- collect i get the following error:
ZodError: [
{
"code": "custom",
"message": "In a category there has to be at least one ref with weight > 0",
"path": [
"plugins",
5,
"groups",
0,
"refs"
]
}
]
What would you expect to happen?
It should show more information of where the error was caused.
Examples File error:
- Error: Failed parsing core config. Path: code-pushup.config.ts.
Examples Parsing error:
- plugins[1].title: Required
- plugins[1].audits: Array must contain at least 1 element(s)
- plugins[1].groups[0].title: Required
- plugins[1].groups[0].refs[0].weight: Required
- persist.format[0]: Invalid enum value. Expected 'json' | 'md', received 'html'
- plugins[1].slug: The slug has to follow the pattern [0-9a-z] followed by multiple optional groups of -[0-9a-z].
What steps did you take?
I used onlyAudits: ['csp-xss'] in the lighthouse config object and run nx code-pushup -- collect i get the following error:
Code PushUp package version
No response
What operation system are you on?
Linux
Node version
No response
Relevant log output
No response
Related
https://github.com/causaly/zod-validation-error/issues/357