Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v6 preview docs #316

Merged
merged 33 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
825cf73
Version v5 docs and keep as latest
fflaten Jun 8, 2024
1c2a46c
Set ident size to 2 spaces for js and ts files
fflaten Jun 8, 2024
57ff457
Generate PesterConfiguration section on Configuration page
fflaten Jun 10, 2024
0542e01
Update configuration docs
fflaten Jun 13, 2024
c677f03
Update installation requirements
fflaten Jun 13, 2024
a9d89b0
Rename PesterConfiguration docs script
fflaten Jun 13, 2024
191bdaa
Update Command Reference to 6.0.0-alpha1
fflaten Jun 13, 2024
c77fd38
Update Command Reference from unreleased build
fflaten Jun 13, 2024
ae8126f
Update TestRegistry to remove guid-reference
fflaten Jun 15, 2024
74943bf
Update TestDrive
fflaten Jun 15, 2024
a726d84
Redirect versioned URIs for lastVersion
fflaten Jun 15, 2024
4702505
Make versioned redirect temporary to avoid indexing
fflaten Jun 15, 2024
225d58d
Use /docs/v6 paths during preview
fflaten Jun 15, 2024
2f812bd
Fix launch config for devcontainer use
fflaten Jun 15, 2024
f46d510
Use New-PesterConfiguration in usage-docs
fflaten Jun 15, 2024
67107f7
Scaffold new migration guide to v6
fflaten Jun 15, 2024
31dd613
Remove new in 5.x references and outdated workarounds
fflaten Jun 16, 2024
cf86c29
Update generate-command-reference.ps1
fflaten Jun 16, 2024
4430817
Add PesterConfiguration docs for v5
fflaten Jun 16, 2024
c2fd294
Add manual workflow to automate docs update
fflaten Jun 16, 2024
9954bb9
Update generate-command-reference.ps1
fflaten Jun 16, 2024
fde83e8
Update workflow
fflaten Jun 16, 2024
4a62154
Fix version references and minor updates
fflaten Jun 16, 2024
a6568d1
Update mocking function in method example
fflaten Jun 16, 2024
872c414
Update TestRegistry example to v5+
fflaten Jun 16, 2024
3b5a250
Add WIP docs for v6 assertions
fflaten Jun 16, 2024
68bffbe
Fix table overflow on mobile in Configuration.mdx
fflaten Jun 17, 2024
4057293
Use fully qualified options names
fflaten Jun 18, 2024
abe251f
Update v5 PesterConfiguration docs
fflaten Jun 18, 2024
0c1dba2
Update docs/usage/configuration.mdx
fflaten Jun 25, 2024
98639d7
Update breaking changes in v6
fflaten Jul 14, 2024
1683785
Add notice about empty or null data
fflaten Jul 14, 2024
8507081
Update docs/migrations/v5-to-v6.mdx
nohwnd Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install",

// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand All @@ -33,7 +33,8 @@
"dbaeumer.vscode-eslint",
"unifiedjs.vscode-mdx",
"ms-vscode.powershell",
"EditorConfig.EditorConfig"
"EditorConfig.EditorConfig",
"github.vscode-github-actions"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ trim_trailing_whitespace = true
indent_size = 4
max_line_length = 80

[*.{json,ps1xml,props,xml,yaml,css}]
[*.{js,jsx,ts,tsx,json,ps1xml,props,xml,yml,yaml,css}]
indent_size = 2
98 changes: 98 additions & 0 deletions .github/workflows/generate-pester-docs.yml
fflaten marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Update Pester Docs
run-name: Update Pester ${{ github.event.inputs.docs_version }} docs to v${{ github.event.inputs.pester_version }}

on:
workflow_dispatch:
inputs:
docs_version:
description: 'Docs version to update'
required: true
default: 'v5'
type: choice
options:
- Current
- v5
- v4
pester_version:
description: 'Pester version to use for docs generation. Format: 5.6.0 or 6.0.0-alpha1'
required: true
type: string

jobs:
generate_docs:
name: Docs PR
runs-on: ubuntu-latest
env:
PESTER: ${{ github.event.inputs.pester_version }}
DOCS: ${{ github.event.inputs.docs_version }}
permissions:
contents: write
pull-requests: write
steps:
- name: Validate Pester version input
run: |
echo "Validating that the provided pester_version input is a valid version-format (x.y.z or x.y.z-suffix)"
echo "${{ env.PESTER }}" | grep -P '^\d+.\d+.\d+(?:-\w+)?$'

- name: Checkout code
uses: actions/checkout@v4

# This step will also install and import modules incl. selected Pester-version
- name: Update Command Reference
id: commands
shell: pwsh
run: |
./generate-command-reference.ps1 -PesterVersion '${{ env.PESTER }}' -DocsVersion '${{ env.DOCS }}'

# Output if any files were modified
$updated = $null -ne (git status -s | Select-String '/commands/')
"updated=$updated" >> $env:GITHUB_OUTPUT
- name: Update PesterConfiguration docs
if: ${{ env.DOCS != 'v4' }}
id: config
shell: pwsh
run: |
./generate-pesterconfiguration-docs.ps1 -PesterVersion '${{ env.PESTER }}' -Style Table -DocsVersion '${{ env.DOCS }}'

# Output if any files were modified
$updated = $null -ne (git status -s | Select-String '/usage/Configuration.mdx')
"updated=$updated" >> $env:GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
id: create-pr
env:
PR_BRANCH: "docs-update/${{ env.DOCS }}-v${{ env.PESTER }}"
TITLE_DOCS_VERSION: "${{ env.DOCS != 'Current' && format('{0} ', env.DOCS) || '' }}"
with:
branch: ${{ env.PR_BRANCH }}
branch-suffix: short-commit-hash
draft: false
# Should always be reviewed by author to fix typos or other errors
reviewers: ${{ github.actor }}
# Set user triggering the workflow as author (default in action)
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
# Github Action as commit (explicit default)
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: "Update generated docs to ${{ env.PESTER }}"
add-paths: |
docs
versioned_docs
title: Update ${{ env.TITLE_DOCS_VERSION }}docs to Pester v${{ env.PESTER }}
body: |
Updates generated documentation using the specified Pester-version.

**Docs version:** ${{ env.DOCS }}
**Pester version:** ${{ env.PESTER }}

| Documentation updated | Result |
|-----------------------|--------|
| Command Reference | ${{ steps.commands.outputs.updated }} |
| PesterConfiguration section | ${{ steps.config.outputs.updated }} |

*PR created using 'Update Pester Docs' workflow*

- name: Output PR details
if: ${{ steps.create-pr.outputs.pull-request-number }}
run: |
echo "### Update Pester Docs successfully completed! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "See [pull request #${{ steps.create-pr.outputs.pull-request-number }}](${{ steps.create-pr.outputs.pull-request-url }})" >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"command": "yarn start --poll",
"command": "yarn start --host 0.0.0.0 --poll 1000",
"name": "Start Docusaurus (with polling)",
"request": "launch",
"type": "node-terminal"
}
]
}
}
4 changes: 2 additions & 2 deletions docs/commands/Add-ShouldOperator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function BeAwesome($ActualValue, [switch] $Negate) {
}
}

return New-Object psobject -Property @{
return [PSCustomObject]@{
Succeeded = $succeeded
FailureMessage = $failureMessage
}
Expand Down Expand Up @@ -166,4 +166,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/AfterAll.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/AfterEach.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/BeforeAll.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/BeforeDiscovery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/BeforeEach.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/Context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/ConvertTo-JUnitReport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/ConvertTo-NUnitReport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/ConvertTo-Pester4Result.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/Describe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/Export-JUnitReport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/Export-NUnitReport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
123 changes: 123 additions & 0 deletions docs/commands/Get-EquivalencyOption.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
id: Get-EquivalencyOption
title: Get-EquivalencyOption
description: Help page for the PowerShell Pester "Get-EquivalencyOption" command
keywords:
- PowerShell
- Pester
- Help
- Documentation
hide_title: false
hide_table_of_contents: false
custom_edit_url: null
---

:::info This page was generated
Contributions are welcome in [Pester-repo](https://github.com/pester/pester).
:::

## SYNOPSIS

Generates an object containing options for checking equivalency.

## SYNTAX

```powershell
Get-EquivalencyOption [[-ExcludePath] <String[]>] [-ExcludePathsNotOnExpected] [[-Comparator] <String>]
[<CommonParameters>]
```

## DESCRIPTION

The `Get-EquivalencyOption` function creates a custom object with options that determine how equivalency between two objects is assessed.
This can be used in scenarios where a deep comparison of objects is required, with the ability to exclude specific paths from the comparison and to choose between different comparison strategies.

## EXAMPLES

### EXAMPLE 1

```powershell
$option = Get-EquivalencyOption -ExcludePath 'Id', 'Timestamp' -Comparator 'Equality'
This example generates an equivalency option object that excludes the 'Id' and 'Timestamp' properties from the comparison and uses a simple equality comparison strategy.
```

### EXAMPLE 2

```powershell
$option = Get-EquivalencyOption -ExcludePathsNotOnExpected
This example generates an equivalency option object that excludes any paths not present on the expected object from the comparison, using the default deep comparison strategy.
```

## PARAMETERS

### -ExcludePath

An array of strings specifying the paths to exclude from the comparison.
Each path should correspond to a property name or a chain of property names separated by dots for nested properties.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: @()
Accept pipeline input: False
Accept wildcard characters: False
```

### -ExcludePathsNotOnExpected

A switch parameter that, when set, excludes any paths from the comparison that are not present on the expected object.
This is useful for ignoring extra properties on the actual object that are not relevant to the comparison.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Comparator

Specifies the comparison strategy to use.
The options are 'Equivalency' for a deep comparison that considers the structure and values of objects, and 'Equality' for a simple equality comparison.
The default is 'Equivalency'.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: Equivalency
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[https://pester.dev/docs/commands/Get-EquivalencyOption](https://pester.dev/docs/commands/Get-EquivalencyOption)

[https://pester.dev/docs/assertions](https://pester.dev/docs/assertions)

## VERSION

*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/Get-ShouldOperator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ standard PowerShell discovery patterns (like `Get-Help Should -Parameter *`).

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
2 changes: 1 addition & 1 deletion docs/commands/InModuleScope.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## VERSION

*This page was generated using comment-based help in [Pester 5.6.0](https://github.com/pester/pester).*
*This page was generated using comment-based help in [Pester 6.0.0-alpha1](https://github.com/pester/pester).*
Loading