Skip to content

Commit 29b9632

Browse files
committed
Add test
1 parent 2e9c8ae commit 29b9632

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

dsc/tests/dsc_version.tests.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
Describe 'tests for metadata versioning' {
5+
It 'returns the correct dsc semantic version in metadata' {
6+
$config_yaml = @"
7+
`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
8+
resources:
9+
- name: Echo
10+
type: Microsoft.DSC.Debug/Echo
11+
properties:
12+
output: 'Hello, World!'
13+
"@
14+
$out = $config_yaml | dsc config get -f - | ConvertFrom-Json
15+
$version = $out.metadata.'Microsoft.DSC'.version -as [System.Management.Automation.SemanticVersion]
16+
$version | Should -Not -BeNullOrEmpty
17+
$dscVersion = (dsc --version).Split(" ")[1]
18+
$version | Should -Be $dscVersion
19+
}
20+
}

0 commit comments

Comments
 (0)