mirror of
https://github.com/actions/node-versions.git
synced 2025-01-11 02:25:19 +00:00
Update to Pester 5
This commit is contained in:
parent
ed56a19091
commit
978acceff5
10
.github/workflows/build-node-packages.yml
vendored
10
.github/workflows/build-node-packages.yml
vendored
@ -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,10 +1,6 @@
|
|||||||
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")
|
||||||
|
|
||||||
|
BeforeAll {
|
||||||
function Get-UseNodeLogs {
|
function Get-UseNodeLogs {
|
||||||
# GitHub Windows images don't have `HOME` variable
|
# GitHub Windows images don't have `HOME` variable
|
||||||
$homeDir = $env:HOME ?? $env:HOMEDRIVE
|
$homeDir = $env:HOME ?? $env:HOMEDRIVE
|
||||||
@ -16,6 +12,7 @@ function Get-UseNodeLogs {
|
|||||||
} | Select-Object -First 1
|
} | Select-Object -First 1
|
||||||
return $useNodeLogFile.Fullname
|
return $useNodeLogFile.Fullname
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Describe "Node.js" {
|
Describe "Node.js" {
|
||||||
It "is available" {
|
It "is available" {
|
||||||
@ -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
Block a user