File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -275,9 +275,11 @@ Describe 'tests for function expressions' {
275
275
properties:
276
276
output: "[parameters('test')]"
277
277
"@
278
- $out = dsc - l trace config get - i $config_yaml 2> $TestDrive / error.log | ConvertFrom-Json - DateKind String
278
+ $out = dsc - l trace config get - i $config_yaml 2> $TestDrive / error.log
279
279
$LASTEXITCODE | Should - Be 0 - Because (Get-Content $TestDrive / error.log - Raw)
280
- $actual = $out.results [0 ].result.actualState.output
280
+ # ConvertFrom-Json will convert the date to a DateTime object, so we use regex to capture the string
281
+ $out -match ' "output":"(?<date>.*?)"' | Should - BeTrue - Because " Output should contain a date"
282
+ $actual = $matches [' date' ]
281
283
# since the datetimes might slightly differ, we remove the seconds and milliseconds
282
284
$expected = $expected -replace ' :\d+\.\d+Z$' , ' Z'
283
285
$actual = $actual -replace ' :\d+\.\d+Z$' , ' Z'
You can’t perform that action at this time.
0 commit comments