@@ -20,6 +20,35 @@ 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
49+
50+ $fakePsd1Path = Join-Path $TestDrive " FakeAdapted.psd1"
51+ Set-Content - Path $fakePsd1Path - Value " @{ ModuleVersion = '0.1.0' }"
2352 $script :OldPSModulePath = $env: PSModulePath
2453 $env: PSModulePath += [System.IO.Path ]::PathSeparator + $TestDrive
2554
@@ -127,4 +156,10 @@ Describe 'Tests for PowerShell resource discovery' {
127156 $out = & $script :discoverScript | ConvertFrom-Json
128157 $out.manifestPath | Should - Contain $manifestPath
129158 }
159+
160+ It ' Should discover adapted resource manifest files' {
161+ Remove-Item - Force - ErrorAction SilentlyContinue - Path $script :cacheFilePath
162+ $out = & $script :discoverScript | ConvertFrom-Json
163+ $out.manifestPath | Should - Contain $adaptedManifestPath
164+ }
130165}
0 commit comments