33
44BeforeDiscovery {
55 $foundBicep = if ($null -ne (Get-Command bicep - ErrorAction Ignore)) {
6+
67 $true
78 } else {
89 $false
@@ -12,7 +13,6 @@ BeforeDiscovery {
1213Describe ' Bicep extension tests' - Skip:(! $foundBicep ) {
1314 It ' Example bicep file should work' {
1415 $bicepFile = Resolve-Path - Path " $PSScriptRoot \..\..\dsc\examples\hello_world.dsc.bicep"
15- Write-Verbose - Verbose (bicep - v)
1616 $out = dsc - l trace config get -f $bicepFile 2> $TestDrive / error.log | ConvertFrom-Json
1717 $LASTEXITCODE | Should - Be 0 - Because (Get-Content - Path $TestDrive / error.log - Raw | Out-String )
1818 $out.results [0 ].result.actualState.output | Should - BeExactly ' Hello, world!'
@@ -22,15 +22,17 @@ Describe 'Bicep extension tests' -Skip:(!$foundBicep) {
2222 It ' Invalid bicep file returns error' {
2323 $bicepFile = " $TestDrive /invalid.bicep"
2424 Set-Content - Path $bicepFile - Value @"
25- myresource invalid 'Microsoft.DSC.Extension/Bicep:1.0' = {
26- name: 'invalid'
27- properties: {
28- output: 'This is invalid'
25+ targetScope = 'invalidScope'
26+
27+ resource invalid 'Microsoft.DSC.Extension/Bicep:1.0' = {
28+ name: 'invalid'
29+ properties: {
30+ output: 'This is invalid'
2931"@
3032 $out = dsc - l trace config get -f $bicepFile 2> $TestDrive / error.log | ConvertFrom-Json
3133 $LASTEXITCODE | Should - Be 4 - Because (Get-Content - Path $TestDrive / error.log - Raw | Out-String )
3234 $content = (Get-Content - Path $TestDrive / error.log - Raw)
3335 $content | Should -Match " Importing file '$bicepFile ' with extension 'Microsoft.DSC.Extension/Bicep'"
34- $content | Should -Match " BCP279: Expected a type at this location "
36+ $content | Should -Match " BCP033 "
3537 }
3638}
0 commit comments