Skip to content

Commit 951cbb4

Browse files
committed
Improve test
1 parent e10fdb4 commit 951cbb4

File tree

4 files changed

+43
-7
lines changed

4 files changed

+43
-7
lines changed

docs/en-US/Get-ChocoLogEntry.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Defaults to last exection.
1414
## SYNTAX
1515

1616
```
17-
Get-ChocoLogEntry [[-Path] <String[]>] [[-Filter] <String>] [[-PatternLayout] <String>] [-Report]
17+
Get-ChocoLogEntry [[-Path] <String[]>] [[-Filter] <String>] [[-PatternLayout] <String>] [-Report] [-NoColor]
1818
[-ProgressAction <ActionPreference>] [<CommonParameters>]
1919
```
2020

@@ -99,6 +99,22 @@ Accept pipeline input: False
9999
Accept wildcard characters: False
100100
```
101101
102+
### -NoColor
103+
Disables colored output in the formatter. When specified, the output will be
104+
displayed without ANSI color codes.
105+
106+
```yaml
107+
Type: SwitchParameter
108+
Parameter Sets: (All)
109+
Aliases:
110+
111+
Required: False
112+
Position: Named
113+
Default value: False
114+
Accept pipeline input: False
115+
Accept wildcard characters: False
116+
```
117+
102118
### -ProgressAction
103119
{{ Fill ProgressAction Description }}
104120

docs/en-US/Read-ChocoLog.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Parses a Chocolatey log into an object that is easier to search and filter.
1414

1515
```
1616
Read-ChocoLog [[-Path] <String[]>] [[-FileLimit] <Int32>] [[-Filter] <String>] [[-PatternLayout] <String>]
17-
[<CommonParameters>]
17+
[-NoColor] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -100,6 +100,22 @@ Accept pipeline input: False
100100
Accept wildcard characters: False
101101
```
102102
103+
### -NoColor
104+
Disables colored output in the formatter. When specified, the output will be
105+
displayed without ANSI color codes.
106+
107+
```yaml
108+
Type: SwitchParameter
109+
Parameter Sets: (All)
110+
Aliases:
111+
112+
Required: False
113+
Position: Named
114+
Default value: False
115+
Accept pipeline input: False
116+
Accept wildcard characters: False
117+
```
118+
103119
### CommonParameters
104120
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
105121

requirements.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
}
1010
}
1111
'psake' = @{
12-
Version = '4.9.0'
12+
Version = '4.9.1'
1313
}
1414
'BuildHelpers' = @{
1515
Version = '2.0.16'
1616
}
1717
'PowerShellBuild' = @{
18-
Version = '0.6.1'
18+
Version = '0.7.3'
1919
}
2020
'PSScriptAnalyzer' = @{
2121
Version = '1.19.1'

tests/ChocoLogParse.tests.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# cSpell:ignore BHPS Ffoo Subkeys
22
BeforeDiscovery {
3+
if ($null -eq $env:BHPSModuleManifest) {
4+
.\build.ps1 -Task Init
5+
}
36
$manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest
47
$outputDir = Join-Path -Path $env:BHProjectPath -ChildPath 'Output'
58
$outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjectName
@@ -106,7 +109,7 @@ Describe 'Read-ChocoLog' {
106109

107110
Context 'For Single File' {
108111
It 'Parses the correct number of sessions' {
109-
($script:parsed).Count | Should -Be 3
112+
($script:parsed).Count | Should -Be 3
110113
}
111114

112115
It 'Parses the correct number of lines per session' {
@@ -140,7 +143,8 @@ Describe 'Read-ChocoLog' {
140143
}
141144

142145
It 'Parses the correct number of lines per session' {
143-
$script:multiple[0].logs.Count | Should -Be 9
146+
$multiLine = $script:multiple | Where-Object { $_.Thread -eq 8748 }
147+
$multiLine.logs.Count | Should -Be 9
144148
}
145149
}
146150
}
@@ -153,7 +157,7 @@ Describe 'Get-ChocoLogEntry' {
153157

154158
Context 'For Single File' {
155159
It 'Parses the correct number of sessions' {
156-
($script:parsedEntry).Count | Should -Be 1
160+
($script:parsedEntry).Count | Should -Be 1
157161
}
158162

159163
It 'Parses the correct number of lines per session' {

0 commit comments

Comments
 (0)