AL-Go/Tests/CreateDevelopmentEnvironmen...

33 строки
1.4 KiB
PowerShell

Get-Module TestActionsHelper | Remove-Module -Force
Import-Module (Join-Path $PSScriptRoot 'TestActionsHelper.psm1')
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
Describe "CreateDevelopmentEnvironment Action Tests" {
BeforeAll {
$actionName = "CreateDevelopmentEnvironment"
$scriptRoot = Join-Path $PSScriptRoot "..\Actions\$actionName" -Resolve
$scriptName = "$actionName.ps1"
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'scriptPath', Justification = 'False positive.')]
$scriptPath = Join-Path $scriptRoot $scriptName
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'actionScript', Justification = 'False positive.')]
$actionScript = GetActionScript -scriptRoot $scriptRoot -scriptName $scriptName
}
It 'Compile Action' {
Invoke-Expression $actionScript
}
It 'Test action.yaml matches script' {
$permissions = [ordered]@{
"contents" = "write"
"pull-requests" = "write"
}
$outputs = [ordered]@{
}
YamlTest -scriptRoot $scriptRoot -actionName $actionName -actionScript $actionScript -permissions $permissions -outputs $outputs
}
# Call action
}