William Cheng a7e92786df
[PowerShell] add more tests to powershell client (#12057)
* add more tests to powershell client

* update spec

* update method name

* add new file
2022-04-06 10:24:32 +08:00

41 lines
1.3 KiB
YAML

#
# OpenAPI Petstore
# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
version: 1.0.{build}
image:
- Visual Studio 2019 # PWSH 7.x
#- Visual Studio 2017 # PS 5.x, PWSH 6.x
#- Ubuntu # PWSH 6.x
# ref: https://www.appveyor.com/docs/windows-images-software/
install:
- pwsh: $PSVersionTable.PSVersion
- pwsh: Install-Module Pester -Force -Scope CurrentUser
build: off
test_script:
- pwsh: |
.\Build.ps1
Import-Module -Name '.\src\PSPetstore'
$Result = Invoke-Pester -PassThru
if ($Result.FailedCount -gt 0) {
$host.SetShouldExit($Result.FailedCount)
exit $Result.FailedCount
}
deploy_script:
- pwsh: |
if ($env:APPVEYOR_REPO_TAG -eq $true -and $null -ne $env:NuGetApiKey) {
.\Build.ps1
try {
Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\PSPetstore\ -Confirm:$False -Verbose
Write-Host "Successfully published the PowerShell module."
} catch {
$host.SetShouldExit($LastExitCode)
Write-Host "Error when running Publish-Module:"
Write-Host $_
exit
}
}