mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-04 00:44:52 +08:00
[macOS] add pester tests to install scripts part-1. (#2286)
* [macOS] add pester tests to install scripts part-1. * changed version * added changes related to common utils installation * added source tests file * removed tests from homebrew * moved jq to homebrew * fix nitpicks * incorrect things are fixed. * fixed some mistakes in the text * commonutils changed. * remove swiftlint installation from toolsets * removed useless string
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1"
|
||||
|
||||
Describe "Node.JS" {
|
||||
Describe "Node.js" {
|
||||
BeforeAll {
|
||||
$os = Get-OSVersion
|
||||
$expectedNodeVersion = if ($os.IsHigherThanMojave) { "v14.*" } else { "v8.*" }
|
||||
}
|
||||
|
||||
It "Node.JS is installed" {
|
||||
It "Node.js is installed" {
|
||||
"node --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Node.JS $expectedNodeVersion is default" {
|
||||
It "Node.js $expectedNodeVersion is default" {
|
||||
(Get-CommandResult "node --version").Output | Should -BeLike $expectedNodeVersion
|
||||
}
|
||||
|
||||
@@ -24,18 +24,18 @@ Describe "Node.JS" {
|
||||
}
|
||||
}
|
||||
|
||||
Describe "NVM" {
|
||||
Describe "nvm" {
|
||||
BeforeAll {
|
||||
$nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh"
|
||||
$nvmInitCommand = ". $nvmPath > /dev/null 2>&1 || true"
|
||||
}
|
||||
|
||||
It "Nvm is installed" {
|
||||
It "nvm is installed" {
|
||||
$nvmPath | Should -Exist
|
||||
"$nvmInitCommand && nvm --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
Context "Nvm versions" {
|
||||
Context "nvm versions" {
|
||||
$NVM_VERSIONS = @(6, 8, 10, 12)
|
||||
$testCases = $NVM_VERSIONS | ForEach-Object { @{NvmVersion = $_} }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user