In Pester 4 the commandlet offers the possibility to explicitly specify the OutputPath.
Invoke-Pester -Script $testFile -PassThru -Verbose -OutputFile $tr `
-OutputFormat NUnitXml -CodeCoverage "$tmp/*-*.ps1" `
-CodeCoverageOutputFile $cc -Show All
In version 5, this option is declared as a legacy parameter set and issues a corresponding warning.
WARNING: You are using Legacy parameter set that adapts Pester 5 syntax to Pester 4 syntax. This parameter set is deprecated, and does not work 100%. The -Strict and -PesterOption parameters are ignored, and providing advanced configuration to -Path (-Script), and -CodeCoverage via a hash table does not work. Please refer to https://github.com/pester/Pester/releases/tag/5.0.1#legacy-parameter-set for more information.
Which implementation is planned for the following versions? If the parameter is no longer available, should the test results be extracted from the result object?
There is pretty good documentation written for the new Pester 5 which you can find here: https://github.com/pester/Pester#simple-and-advanced-interface.
That link should take you to the specific section that you're looking for.
Essentially, they moved the configuration to an assembly class
[PesterConfiguration]
. You can access the defaults by using[PesterConfigruation]::Default
or more likely cast it to a new object that you will configure with your specific settings and output path. You could do that like this as an example:You then pass that configuration object to Invoke-Pester. i.e.
Invoke-Pester -Configuration $configuration
You can still use some of the parameters in that 'legacy' style, Pester will just yell at you so that you aren't too surprised when it gets deprecated.
As a side note- I do not see a nunit format for the test output so I don't know if they discontinued that. The only one I see is 'JaCoCo'.