appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 65 forks source link

Pester 4.0.4: broken builds with custom assertions #1681

Open stuartleeks opened 7 years ago

stuartleeks commented 7 years ago

I'm getting an error in my build that 'MatchArrayOrdered is not a valid Should operator`.

Digging into this, it looks like Pester 4.0.4 is installed on the build agent. MatchArrayOrdered is a custom assertion for Pester, and in v4 they changed how assertions are registered. The issue is that MatchArrayOrdered isn't updated to Pester 4, and (worse) Pester 4 doesn't actually currently allow custom assertions to be registered! https://github.com/pester/Pester/issues/590

Is there any way to remove Pester 4.0.4 for a build? I tried calling Remove-Module but that didn't help.

IlyaFinkelshteyn commented 7 years ago

We do not install Pester on build workers, at least intentionally. Can you please share how did you figure out that 4.0.4 is installed? Also can you please explain how to repro this error with MatchArrayOrdered (public repo with repro would be great). We will add this to regression tests. In any case I think that Install-Package -Name Pester -RequiredVersion <verion_you_need> -ProviderName Nuget -Force at install stage should help. List of available versions is here: https://www.nuget.org/packages/Pester