Skip to content

Commit 1b80ac1

Browse files
committed
add bicepconfig file
1 parent a69e532 commit 1b80ac1

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

dsc/examples/bicepconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"experimentalFeaturesEnabled": {
3+
"desiredStateConfiguration": true
4+
}
5+
}

extensions/bicep/bicep.tests.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
BeforeDiscovery {
55
$foundBicep = if ($null -ne (Get-Command bicep -ErrorAction Ignore)) {
6+
67
$true
78
} else {
89
$false
@@ -12,7 +13,6 @@ BeforeDiscovery {
1213
Describe '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

Comments
 (0)