1
- param (
2
- [Version ] [Parameter (Mandatory = $true )] [ValidateNotNullOrEmpty ()]
3
- $Version
4
- )
5
-
6
1
Import-Module (Join-Path $PSScriptRoot " ../helpers/pester-extensions.psm1" )
7
2
8
- function Get-UseNodeLogs {
9
- # GitHub Windows images don't have `HOME` variable
10
- $homeDir = $env: HOME ?? $env: HOMEDRIVE
11
- $logsFolderPath = Join-Path - Path $homeDir - ChildPath " runners/*/_diag/pages" - Resolve
12
-
13
- $useNodeLogFile = Get-ChildItem - Path $logsFolderPath | Where-Object {
14
- $logContent = Get-Content $_.Fullname - Raw
15
- return $logContent -match " setup-node@v"
16
- } | Select-Object - First 1
17
- return $useNodeLogFile.Fullname
3
+ BeforeAll {
4
+ function Get-UseNodeLogs {
5
+ # GitHub Windows images don't have `HOME` variable
6
+ $homeDir = $env: HOME ?? $env: HOMEDRIVE
7
+ $logsFolderPath = Join-Path - Path $homeDir - ChildPath " runners/*/_diag/pages" - Resolve
8
+
9
+ $useNodeLogFile = Get-ChildItem - Path $logsFolderPath | Where-Object {
10
+ $logContent = Get-Content $_.Fullname - Raw
11
+ return $logContent -match " setup-node@v"
12
+ } | Select-Object - First 1
13
+ return $useNodeLogFile.Fullname
14
+ }
18
15
}
19
16
20
17
Describe " Node.js" {
@@ -24,7 +21,7 @@ Describe "Node.js" {
24
21
25
22
It " version is correct" {
26
23
$versionOutput = Invoke-Expression " node --version"
27
- $versionOutput | Should -Match $Version
24
+ $versionOutput | Should -Match $env: VERSION
28
25
}
29
26
30
27
It " is used from tool-cache" {
0 commit comments