Closed it-praktyk closed 7 years ago
Like this? (are the Get and Set really necessary? Dave removed them from the migration guide because they are "internal". And I also don't know why would anyone ever use them in their tests, but on the other hand it is public api.
function Throw-RenamedFunction ($NewName) {
throw "This command has been renamed to '$NewName' please update your usage. For more information see: https://github.com/pester/Pester/wiki/Migrating-from-Pester-3-to-Pester-4" }
function Assert-VerifiableMocks { Throw-RenamedFunction -NewName 'Assert-VerifiableMock' }
function Get-MockDynamicParameters { Throw-RenamedFunction -NewName 'Get-MockDynamicParameters' }
function Set-DynamicParameterVariables { Throw-RenamedFunction -NewName 'Set-DynamicParameterVariable' }
Currently seeing a similar issue wherein the first call to Assert-VerifiableMocks
gives
RuntimeException: The Assert-VerifiableMocks command may only be used from a Pester test script.
However all subsequent calls to Assert-VerifiableMocks
in the same manner succeed. Does this sound related or should I open a new issue?
The exception doesn't make much sense because we are running from a Pester test script...
@Blackbaud-ShaydeNofziger Which version of Pester are you using?
@nohwnd 4.0.7, but it seems it falls back to 4.0.6, presumably because the plural command no longer exists.
Please
Get-Module
before and after running your tests.I expected that after you will have loaded two versions of Pester.
@it-praktyk D'oh! Thank you....
@nohwnd, I like it!
The breaking changes introduced by #860 in Pester 4.0.7, means renaming of functions
I propose to add additional functions (with plural names like they were in Pester 3.4.6 with warning/error (?) message about breaking change or deprecation.
Pester v. 4.0.7 only
Pester v. 3.4.6 available too