-
Notifications
You must be signed in to change notification settings - Fork 253
chore: add UX tests around @jsii/kernel serializer errors #3632
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
Conversation
Bring attention to error messages as part of the contract of the `@jsii/kernel` serialization component, as such messages are currently a known pain point (not specific enough, confusing, overloaded, ...). Intoriducing snapshot tests, and quick win improvements to the existing error messages where possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Repeated enum variants in CDK breaking the benchmarks will be fixed on the cdk side.
...(renderValue | ||
? [ | ||
`${ | ||
causes.length > 0 ? '\u{251C}' : '\u{2570}' | ||
}\u{2500}\u{2500} \u{1F6D1} Failing value is ${describeTypeOf( | ||
value, | ||
)}`, | ||
...(value == null | ||
? [] | ||
: inspect(value, false, 0) | ||
.split('\n') | ||
.map( | ||
(l) => | ||
`${causes.length > 0 ? '\u{2502}' : ' '} ${l}`, | ||
)), | ||
] | ||
: []), | ||
...(causes.length > 0 | ||
? [ | ||
'\u{2570}\u{2500}\u{2500} \u{1F50D} Failure reason(s):', | ||
...causes.map( | ||
(cause, idx) => | ||
` ${ | ||
idx < causes.length - 1 ? '\u{251C}' : '\u{2570}' | ||
}\u{2500}${ | ||
causes.length > 1 | ||
? ` [${cause.context ?? inspect(idx)}]` | ||
: '' | ||
} ${cause.message.split('\n').join('\n ')}`, | ||
), | ||
] | ||
: []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably could extract into a function? Feels tough to read here. Not blocking.
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
Merging (with squash)... |
Bring attention to error messages as part of the contract of the
@jsii/kernel
serialization component, as such messages are currently aknown pain point (not specific enough, confusing, overloaded, ...).
Introducing snapshot tests, and quick win improvements to the existing
error messages where possible.
Fixes #3636
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.