Closed lxs65 closed 6 months ago
Thanks for the report. Can repro and confirm, affecting all native applications when using parameterfilter. Will be fixed in 5.6.0 /cc @nohwnd
did you find the problem? Are we trying to log a value that is not there when writing the diagnostic log?
Yeah. Native commands don't have CommandMetadata which I completely forgot when writing the "you might have inherited a variable in parameterfilter causing a false positive" logging. See PR :)
Checklist
What is the issue?
When mocking the
dotnet
CLI command (possibly other native commands as well) and testing withShould -Invoke
makes the test succeed (as expected) with output verbosity set to 'Detailed' but that very same test fails with aRuntimeException
when opting for the 'Diagnostic' output verbosity (or have Debug.WriteDebugMessagesFrom include 'Mock').Expected Behavior
It is expected the test succeeds without throwing when applying 'Diagnostic' output verbosity, just like it succeeds when using 'Detailed' output verbosity.
Steps To Reproduce
Using the following "helper" cmdlet:
And testing this using:
This test as provided succeeds. Changing the output verbosity in
$PesterPreference
to 'Diagnostic' will result in:P.S. My real code-under-test does not actually use the "helper" cmdlet for invoking the
dotnet
CLI. It is just there to as simple as possible show the issue.P.S. (2) It does not make a difference if I change
into
or
into
etc...
Describe your environment
Pester version : 5.5.0 PowerShell version: 7.4.2 OS version: Microsoft Windows NT 10.0.22631.0
Possible Solution?
No response