Update to Pester 5

This commit is contained in:
MaksimZhukov 2020-08-24 20:07:31 +03:00
parent ed56a19091
commit 978acceff5
2 changed files with 14 additions and 23 deletions

View File

@ -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:

View File

@ -1,10 +1,6 @@
param (
[Version] [Parameter (Mandatory = $true)] [ValidateNotNullOrEmpty()]
$Version
)
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
BeforeAll {
function Get-UseNodeLogs {
# GitHub Windows images don't have `HOME` variable
$homeDir = $env:HOME ?? $env:HOMEDRIVE
@ -16,6 +12,7 @@ function Get-UseNodeLogs {
} | Select-Object -First 1
return $useNodeLogFile.Fullname
}
}
Describe "Node.js" {
It "is available" {
@ -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" {