Skip to content

Commit 3360cb6

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
update tracing tests
1 parent bc98145 commit 3360cb6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

dsc/tests/dsc_tracing.tests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Describe 'tracing tests' {
1919

2020
It 'trace level error does not emit other levels' {
2121
$logPath = "$TestDrive/dsc_trace.log"
22-
$null = '{}' | dsc --trace-level error resource get -r 'DoesNotExist' 2> $logPath
22+
$null = '{}' | dsc --trace-level error resource list 'DoesNotExist' 2> $logPath
2323
$log = Get-Content $logPath -Raw
2424
$log | Should -Not -BeLikeExactly "* WARNING *"
2525
$log | Should -Not -BeLikeExactly "* INFO *"
@@ -29,18 +29,18 @@ Describe 'tracing tests' {
2929

3030
It 'trace format plaintext does not emit ANSI' {
3131
$logPath = "$TestDrive/dsc_trace.log"
32-
$null = '{}' | dsc --trace-format plaintext resource get -r 'DoesNotExist' 2> $logPath
32+
$null = '{}' | dsc --trace-format plaintext resource list 'DoesNotExist' 2> $logPath
3333
$log = Get-Content $logPath -Raw
3434
$log | Should -Not -BeLikeExactly "*``[0m*"
3535
}
3636

3737
It 'trace format json emits json' {
3838
$logPath = "$TestDrive/dsc_trace.log"
39-
$null = '{}' | dsc --trace-format json resource get -r 'DoesNotExist' 2> $logPath
39+
$null = '{}' | dsc --trace-format json resource list 'DoesNotExist' 2> $logPath
4040
foreach ($line in (Get-Content $logPath)) {
4141
$trace = $line | ConvertFrom-Json -Depth 10
4242
$trace.timestamp | Should -Not -BeNullOrEmpty
43-
$trace.level | Should -BeIn 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'
43+
$trace.level | Should -BeIn 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE'
4444
$trace.fields.message | Should -Not -BeNullOrEmpty
4545
}
4646
}
@@ -55,12 +55,12 @@ Describe 'tracing tests' {
5555
param($level, $sourceExpected)
5656

5757
$logPath = "$TestDrive/dsc_trace.log"
58-
$null = '{}' | dsc -l $level resource get -r 'DoesNotExist' 2> $logPath
58+
$null = '{}' | dsc -l $level resource list 'DoesNotExist' 2> $logPath
5959
$log = Get-Content $logPath -Raw
6060
if ($sourceExpected) {
61-
$log | Should -BeLike "*dsc*: *"
61+
$log | Should -BeLike "*dsc_lib*: *"
6262
} else {
63-
$log | Should -Not -BeLike "*dsc*: *"
63+
$log | Should -Not -BeLike "*dsc_lib*: *"
6464
}
6565
}
6666
}

0 commit comments

Comments
 (0)