@@ -19,7 +19,7 @@ Describe 'tracing tests' {
19
19
20
20
It ' trace level error does not emit other levels' {
21
21
$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
23
23
$log = Get-Content $logPath - Raw
24
24
$log | Should -Not - BeLikeExactly " * WARNING *"
25
25
$log | Should -Not - BeLikeExactly " * INFO *"
@@ -29,18 +29,18 @@ Describe 'tracing tests' {
29
29
30
30
It ' trace format plaintext does not emit ANSI' {
31
31
$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
33
33
$log = Get-Content $logPath - Raw
34
34
$log | Should -Not - BeLikeExactly " *`` [0m*"
35
35
}
36
36
37
37
It ' trace format json emits json' {
38
38
$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
40
40
foreach ($line in (Get-Content $logPath )) {
41
41
$trace = $line | ConvertFrom-Json - Depth 10
42
42
$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'
44
44
$trace.fields.message | Should -Not - BeNullOrEmpty
45
45
}
46
46
}
@@ -55,12 +55,12 @@ Describe 'tracing tests' {
55
55
param ($level , $sourceExpected )
56
56
57
57
$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
59
59
$log = Get-Content $logPath - Raw
60
60
if ($sourceExpected ) {
61
- $log | Should - BeLike " *dsc *: *"
61
+ $log | Should - BeLike " *dsc_lib *: *"
62
62
} else {
63
- $log | Should -Not - BeLike " *dsc *: *"
63
+ $log | Should -Not - BeLike " *dsc_lib *: *"
64
64
}
65
65
}
66
66
}
0 commit comments