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