Skip to content

Commit cf73de3

Browse files
committed
move to BeforeAll
1 parent c157972 commit cf73de3

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

dsc/tests/dsc_resource_condition.tests.ps1

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33

4-
BeforeDiscovery {
5-
$configYaml = @'
6-
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
7-
resources:
8-
- name: test
9-
type: Microsoft.DSC.Debug/Echo
10-
condition: "[equals('skip', 'yes')]"
11-
properties:
12-
output: "This should not be executed"
13-
- name: test2
14-
type: Microsoft.DSC.Debug/Echo
15-
condition: "[equals('no', 'no')]"
16-
properties:
17-
output: "This should be executed"
4+
Describe 'Resource condition tests' {
5+
BeforeAll {
6+
$configYaml = @'
7+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
8+
resources:
9+
- name: test
10+
type: Microsoft.DSC.Debug/Echo
11+
condition: "[equals('skip', 'yes')]"
12+
properties:
13+
output: "This should not be executed"
14+
- name: test2
15+
type: Microsoft.DSC.Debug/Echo
16+
condition: "[equals('no', 'no')]"
17+
properties:
18+
output: "This should be executed"
1819
'@
20+
}
1921

20-
}
21-
22-
Describe 'Resource condition tests' {
2322
It 'resource should be skipped for <operation>' -TestCases @(
2423
@{ operation = 'get'; property = 'actualState' },
2524
@{ operation = 'set'; property = 'afterState' },

0 commit comments

Comments
 (0)