assert
assert copied to clipboard
Allow to pass a thunk as a message factory to assertions
trafficstars
It is useful in order to delay generating a message.
At the moment the assertion does not pass the message is generated. Otherwise the thunk is not executed.
What would be the real life use case scenario for this?
Sometimes my error messages are
- heavy to compute
- touch object properties that are not initialised and are not needed to be initialised except for the error message
so I'd rather skip that for happy path.
@BackEndTea Hi, is there a will to add lazy messages?