Remove Mock fallthrough #2654
Remove Mock fallthrough #2654
Build #20250703.1 had test failures
Details
- Failed: 175 (1.14%)
- Passed: 14,846 (97.07%)
- Other: 273 (1.79%)
- Total: 15,294
Annotations
Check failure on line 3211 in Build log
azure-pipelines / Pester PR
Build log #L3211
[-] <ScriptBlock> failed with:
Check failure on line 3799 in Build log
azure-pipelines / Pester PR
Build log #L3799
[-] When calling Mock on existing function without matching bound params.Should throw because not mock matched the invocation 15ms (14ms|1ms)
Check failure on line 3807 in Build log
azure-pipelines / Pester PR
Build log #L3807
[-] When calling Mock on existing function without matching unbound arguments.Should throw because not mock matched the invocation 19ms (19ms|1ms)
Check failure on line 3815 in Build log
azure-pipelines / Pester PR
Build log #L3815
[-] When calling Mock on a module-internal function..Using Mock -ModuleName "ModuleName" "CommandName" syntax.Should only call mocks within the same module 23ms (11ms|12ms)
azure-pipelines / Pester PR
When calling Mock on existing function without matching bound params.Should throw because not mock matched the invocation
Expected an exception with message like 'Mock felt though' to be thrown, but the message was 'The mock for command 'FunctionUnderTest' did not match any filtered behavior, and there was no default behavior.
Performed ParameterFilter evaluations:
mock filter: { $param1 -eq "test" } with parameters: param1 = badTest
'. from /home/vsts/work/1/s/bin/Pester.psm1:15517 char:17
+ … throw "The mock for command '$($Hook.CommandName)' did no …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raw output
at { FunctionUnderTest "badTest" } | Should -Throw "Mock felt though", /home/vsts/work/1/s/tst/functions/Mock.Tests.ps1:378
azure-pipelines / Pester PR
When calling Mock on existing function without matching unbound arguments.Should throw because not mock matched the invocation
Expected an exception with message like 'Mock felt though' to be thrown, but the message was 'The mock for command 'FunctionUnderTestWithoutParams' did not match any filtered behavior, and there was no default behavior.
Performed ParameterFilter evaluations:
mock filter: { $param1 -eq "test" -and $args[0] -eq 'notArg0' } with parameters: param1 = test
'. from /home/vsts/work/1/s/bin/Pester.psm1:15517 char:17
+ … throw "The mock for command '$($Hook.CommandName)' did no …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raw output
at { FunctionUnderTestWithoutParams -param1 "test" "arg0" } | Should -Throw "Mock felt though", /home/vsts/work/1/s/tst/functions/Mock.Tests.ps1:393
azure-pipelines / Pester PR
When calling Mock on a module-internal function..Using Mock -ModuleName "ModuleName" "CommandName" syntax.Should only call mocks within the same module
RuntimeException: The mock for command 'InternalFunction' did not match any filtered behavior, and there was no default behavior.
Performed ParameterFilter evaluations:
mock filter: { $args[0] -eq 'Test' } without any parameters
azure-pipelines / Pester PR
When calling Mock on a module-internal function..Using Mock -ModuleName "ModuleName" "CommandName" syntax.Should work even if the function is weird and steps on the automatic $ExecutionContext variable.
RuntimeException: The mock for command 'InternalFunction' did not match any filtered behavior, and there was no default behavior.
Performed ParameterFilter evaluations:
mock filter: { $args[0] -eq 'Test' } without any parameters