Allow testing additional error properties with t.throws(Async)
#3240
tommy-mitchell
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
This will hopefully change: #3201 |
Beta Was this translation helpful? Give feedback.
1 reply
-
I don't bother with the guards, instead in Typescript I use the ! assertion so the type checker is happy. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Errors can be extended to have additional properties, such as with
execa
'schildProcessResult
:Example of additional error properties
Since assertions don't throw (#3201), testing these values requires guarding against
undefined
and disallows destructuring the return value oft.throws(Async)
itself:It'd be much nicer to test these error properties directly:
Beta Was this translation helpful? Give feedback.
All reactions