Update to Pester 5
This commit is contained in:
parent
ed56a19091
commit
978acceff5
|
@ -104,15 +104,9 @@ jobs:
|
|||
|
||||
- name: Run tests
|
||||
run: |
|
||||
Install-Module Pester -Force -Scope CurrentUser -RequiredVersion 4.10.1
|
||||
Install-Module Pester -Force -Scope CurrentUser
|
||||
Import-Module Pester
|
||||
$pesterParams = @{
|
||||
Path="./Node.Tests.ps1";
|
||||
Parameters=@{
|
||||
Version="$env:VERSION";
|
||||
}
|
||||
}
|
||||
Invoke-Pester -Script $pesterParams -EnableExit
|
||||
Invoke-Pester -Script ./Node.Tests.ps1 -EnableExit
|
||||
working-directory: ./tests
|
||||
|
||||
publish_release:
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
param (
|
||||
[Version] [Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()]
|
||||
$Version
|
||||
)
|
||||
|
||||
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
|
||||
|
||||
function Get-UseNodeLogs {
|
||||
BeforeAll {
|
||||
function Get-UseNodeLogs {
|
||||
# GitHub Windows images don't have `HOME` variable
|
||||
$homeDir = $env:HOME ?? $env:HOMEDRIVE
|
||||
$logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve
|
||||
|
@ -15,6 +11,7 @@ function Get-UseNodeLogs {
|
|||
return $logContent -match "setup-node@v"
|
||||
} | Select-Object -First 1
|
||||
return $useNodeLogFile.Fullname
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Node.js" {
|
||||
|
@ -24,7 +21,7 @@ Describe "Node.js" {
|
|||
|
||||
It "version is correct" {
|
||||
$versionOutput = Invoke-Expression "node --version"
|
||||
$versionOutput | Should -Match $Version
|
||||
$versionOutput | Should -Match $env:VERSION
|
||||
}
|
||||
|
||||
It "is used from tool-cache" {
|
||||
|
|
Loading…
Reference in New Issue