Closed akaer closed 4 months ago
Thanks for the detailed report. Will get this fixed in next release.
Suggestion looks good. I'm wondering if $o -as [string]
might work as well. Need to double check behavior differences besides ignoring null and compatibility.
Checklist
What is the issue?
Depending on the type of output the processing might fail during calling the
ToString()
method withinWrite-NUnit3OutputElement
. As soon as this error occurs, the test result file (TestResult.OutputPath) is no longer written completely.Stacktrace might be
or another example
Expected Behavior
Complete test result file (TestResult.OutputPath) is written. If there might be errors during processing the output-element might be skipped.
Steps To Reproduce
Describe your environment
Pester version : 5.5.0 C:\Program Files\WindowsPowerShell\Modules\Pester\5.5.0\Pester.psm1 PowerShell version : 5.1.22621.2506 OS version : Microsoft Windows NT 10.0.22631.0
Possible Solution?
Only a suggestion. Maybe check for not null in combination with try / silent catch like