Skip to main content
Version: v6

Export-JUnitReport

This page was generated

Contributions are welcome in Pester-repo.

SYNOPSIS

Exports a Pester result-object to an JUnit-compatible XML-report

SYNTAX

Export-JUnitReport [-Result] <Run> [-Path] <string>

DESCRIPTION

Pester can generate a result-object containing information about all tests that are processed in a run. This object can then be exported to an JUnit-compatible XML-report using this function. The report is generated using the JUnit 4-schema.

This can be useful for further processing or publishing of test results, e.g. as part of a CI/CD pipeline.

EXAMPLES

EXAMPLE 1

$p = Invoke-Pester -Passthru
$p | Export-JUnitReport -Path TestResults.xml

This example runs Pester using the Passthru option to retrieve the result-object and exports it as an JUnit 4-compatible XML-report.

PARAMETERS

-Path

The path where the XML-report should be saved.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Result

Result object from a Pester-run. This can be retrieved using Invoke-Pester -Passthru or by using the Run.PassThru configuration-option.

Type: Pester.Run
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Pester.Run

OUTPUTS

NOTES

VERSION

This page was generated using comment-based help in Pester 6.0.0.