@@ -20,6 +20,32 @@ BeforeAll {
2020
2121 $manifestPath = Join-Path $TestDrive " fake.dsc.resource.json"
2222 $fakeManifest | ConvertTo-Json - Depth 10 | Set-Content - Path $manifestPath
23+
24+ $fakeAdaptedManifest = @ {
25+ ' $schema' = " https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json"
26+ type = " Test/FakeAdaptedResource"
27+ kind = " resource"
28+ version = " 0.1.0"
29+ capabilities = @ (" get" , " set" , " test" )
30+ description = " A fake adapted resource for regression testing."
31+ requireAdapter = " Microsoft.Adapter/PowerShell"
32+ path = " FakeAdapted.psd1"
33+ schema = @ {
34+ embedded = @ {
35+ ' $schema' = " https://json-schema.org/draft/2020-12/schema"
36+ title = " Test/FakeAdaptedResource"
37+ type = " object"
38+ required = @ (" Name" )
39+ additionalProperties = $false
40+ properties = @ {
41+ Name = @ { type = " string" ; title = " Name" ; description = " The name." }
42+ }
43+ }
44+ }
45+ }
46+
47+ $adaptedManifestPath = Join-Path $TestDrive " fake.dsc.adaptedresource.json"
48+ $fakeAdaptedManifest | ConvertTo-Json - Depth 10 | Set-Content - Path $adaptedManifestPath
2349 $script :OldPSModulePath = $env: PSModulePath
2450 $env: PSModulePath += [System.IO.Path ]::PathSeparator + $TestDrive
2551
@@ -127,4 +153,10 @@ Describe 'Tests for PowerShell resource discovery' {
127153 $out = & $script :discoverScript | ConvertFrom-Json
128154 $out.manifestPath | Should - Contain $manifestPath
129155 }
156+
157+ It ' Should discover adapted resource manifest files' {
158+ Remove-Item - Force - ErrorAction SilentlyContinue - Path $script :cacheFilePath
159+ $out = & $script :discoverScript | ConvertFrom-Json
160+ $out.manifestPath | Should - Contain $adaptedManifestPath
161+ }
130162}
0 commit comments