AssertionScope - allow reportables which are only calculated on failure#1515
Conversation
dennisdoomen
left a comment
There was a problem hiding this comment.
Would you be willing to add the corresponding release note changes and possibly some docs as explained in the Pull Request template?
Absolutely! I've added to the release notes for 6.0.0. Please let me know if I missed anything there. I don't see any reference to the existing |
|
|
||
| private sealed class DeferredReportable | ||
| { | ||
| private readonly Lazy<string> lazyValue; |
There was a problem hiding this comment.
Is there a known case where valueFunc is invoked more than once?
There was a problem hiding this comment.
We're only calling ContextDateItems.GetReportable when the scope is disposed, and only if it's the outer scope, so I think we're fine.
|
You need to update the approval files. |
|
Thank you for your contribution. |
Discussed here - I thought I'd contribute a potential solution.
My personal use case is that I've got some costly calculations to display user-friendly failure info, and I'd like to avoid doing this for the 99% case where the tests run successfully.
IMPORTANT
AcceptApiChanges.ps1/AcceptApiChanges.sh.