Skip to content

Module Manifest Template Tests Don't Work with Pester 5 #363

@mattmcnabb

Description

@mattmcnabb

The built-in module manifest template includes this test:

It 'Passes Test-ModuleManifest' {
        Test-ModuleManifest -Path $ModuleManifestPath | Should Not BeNullOrEmpty
        $? | Should Be $true
    }

Which returns this error with Pester 5:

Should : Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4
At C:\Users\matt\Documents\Repos\JsonWhois\test\JsonWhois.Tests.ps1:6 char:57
+ ... t-ModuleManifest -Path $ModuleManifestPath | Should Not BeNullOrEmpty
+                                                  ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Should

Can we update this to use the canonical Should -Not -BeNullOrEmpty instead of Should Not BeNullOrEmpty? Thanks!

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions