Skip to content

Commit

Permalink
fix bicep test file pester test (#4019)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyconsulting authored Sep 25, 2023
1 parent 62ad2aa commit c86a922
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utilities/pipelines/staticValidation/module.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1317,14 +1317,13 @@ Describe 'Test file tests' -Tag 'TestTemplate' {
}
}

It "[<moduleFolderName>] Bicep test deployment files should invoke test like [`module testDeployment '../.*main.bicep' = {`]" -TestCases ($deploymentTestFileTestCases | Where-Object { (Split-Path $_.testFilePath -Extension) -eq '.bicep' }) {
It "[<moduleFolderName>] Bicep test deployment files should invoke test like [`module testDeployment '../.*main.bicep' = `]" -TestCases ($deploymentTestFileTestCases | Where-Object { (Split-Path $_.testFilePath -Extension) -eq '.bicep' }) {

param(
[object[]] $testFileContent
)

$testIndex = ($testFileContent | Select-String ("^module testDeployment '..\/.*main.bicep' = {$") | ForEach-Object { $_.LineNumber - 1 })[0]

$testIndex = ($testFileContent | Select-String ("^module testDeployment '..\/.*main.bicep' = (\[for .+: )?{$") | ForEach-Object { $_.LineNumber - 1 })[0]
$testIndex -ne -1 | Should -Be $true -Because 'the module test invocation should be in the expected format to allow identification.'
}

Expand Down

0 comments on commit c86a922

Please sign in to comment.