Closed neilrees closed 4 months ago
Suspect it's due to the exception being re-thrown in DelegateRunner
and overwriting the stack trace
https://github.com/machine/machine.specifications/blob/f2ded639870ae1aa3fa30480085fbab425b21545/src/Machine.Specifications.Core/Runner/Impl/DelegateRunner.cs#L43
Which subsequently gets entirely filtered out in ExceptionResult
:
https://github.com/machine/machine.specifications/blob/f2ded639870ae1aa3fa30480085fbab425b21545/src/Machine.Specifications.Core/ExceptionResult.cs#L91
This has been released as v1.1.2
If an exception is thrown from a async function the stack trace is not captured by the test runner.
For example:
Produces as test output:
Where as a syncronous method:
Produces:
Behavior is the same in Rider,
dotnet test
and Visual Studio.Tested with:
Here's a test class that repros the issue for
Establish
,Because
andIt
delegates: