Skip to content

Commit 021277b

Browse files
authored
Merge pull request #19 from it-praktyk/master
The project README.md updated, example added to Format-Pester v. 1.4.1
2 parents 2498da0 + d72706c commit 021277b

File tree

5 files changed

+59
-70
lines changed

5 files changed

+59
-70
lines changed

Format-Pester/Format-Pester.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RootModule = 'Format-Pester.psm1'
1414
# Version number of this module.
1515
# If you are increasing ModuleVersion please change also the values of variable 'ScriptVersion' in the Format-Pester.ps1 file
1616
# Verify also translations and increase the values of msg00 fields
17-
ModuleVersion = '1.4.0'
17+
ModuleVersion = '1.4.1'
1818

1919
# ID used to uniquely identify this module
2020
GUID = 'daa609a5-1293-4f62-9467-1a120c529e87'
@@ -97,7 +97,7 @@ PrivateData = @{
9797
Tags = @('Pester','PScribo')
9898

9999
# A URL to the license for this module.
100-
# LicenseUri = 'https://github.com/equelin/Format-Pester/blob/master/LICENSE'
100+
LicenseUri = 'https://github.com/equelin/Format-Pester/blob/master/LICENSE'
101101

102102
# A URL to the main website for this project.
103103
ProjectUri = 'https://github.com/equelin/Format-Pester'
@@ -106,7 +106,7 @@ PrivateData = @{
106106
# IconUri = ''
107107

108108
# ReleaseNotes of this module
109-
# ReleaseNotes = ''
109+
ReleaseNotes = 'https://github.com/equelin/Format-Pester/blob/master/VERSIONS.md'
110110

111111
} # End of PSData hashtable
112112

Format-Pester/Public/Format-Pester.ps1

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,20 @@ Function Format-Pester {
7171
This command will document the results of the Pester's tests.
7272
Documents will be stored in the current path and they will be available in 3 formats (.html,.docx and .txt).
7373
74+
.EXAMPLE
75+
Invoke-Pester -PassThru | Export-Clixml -Path .\Test-Result.xml
76+
77+
Import-Clixml -Path .\Test-Result.xml | Format-Pester -Format .\ -BaseFileName Test-Result -Format HTML -FailedOnly
78+
79+
The first command you can run e.g. on a server where PScribo and Format-Pester is not installed. The tests results will be stored in a file as xml representation of object.
80+
81+
After copy the file to the computer where PScribo and Format-Pester are available you can generate report. The html file will be generated with results of failed tests only.
82+
7483
.LINK
7584
https://github.com/equelin/Format-Pester
85+
86+
.LINK
87+
https://github.com/iainbrighton/PScribo
7688
7789
.NOTES
7890
Initial author: Erwan Quelin
@@ -84,10 +96,7 @@ Function Format-Pester {
8496
LICENSE
8597
Licensed under the MIT License - https://github.com/equelin/Format-Pester/blob/master/LICENSE
8698
87-
TODO
88-
- Pester test need to be updated - yes, post factum TDD ;-)
89-
90-
#>
99+
#>
91100

92101
[CmdletBinding(DefaultParameterSetName = 'AllParamSet')]
93102
[OutputType([IO.FileInfo])]
@@ -150,7 +159,7 @@ Function Format-Pester {
150159
[Switch]$DumpPScriboObject
151160
)
152161

153-
[Version]$ScriptVersion = "1.4.0"
162+
[Version]$ScriptVersion = "1.4.1"
154163

155164
If ($Version.IsPresent) {
156165

README.md

Lines changed: 30 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ Powershell module for documenting Pester's results.
55

66
All the formating work is done by the module [PScribo](https://github.com/iainbrighton/PScribo).
77

8-
## Example
8+
Reports are generated base on a custom PowerShell object returned by Invoke-Pester run with the parameter `PassThru`. NUnit style files generated by Pester are not supported at that moment by Format-Pester.
9+
10+
If you can't generate report on a computer where tests are executed please save tests results piping them to `Export-Clixml`.
11+
12+
You can be interested also in the [ReportUnit](http://reportunit.relevantcodes.com/) tool what is a report generator for the test-runner family. It uses stock reports from NUnit, MsTest, xUnit, TestNG and Gallio and converts them HTML reports with dashboards.
13+
14+
## Report example
915

1016
![](./img/format-pester.png)
1117

@@ -14,96 +20,60 @@ Screenshot from HTML report generated by Format-Pester v. 1.3.0, PScribo v. 0.7.
1420
More examples you can find [here](/examples/).
1521

1622
## Supported languages
17-
Since version 1.3.0 internationalization of generated reports is supported.
23+
Since version 1.3.0 internationalization of generated reports is supported. Internalization means that report parts e.g. section names, columns headers, etc. can be wrote in a language different than English.
1824

1925
Currently available languages
2026
- en-US - English United Staes - main language
2127
- pl-PL - Polish
2228

23-
If would you like add support for your language please read the section 'Information for translators'
29+
If would you like add support for your language please read the section [Information for translators](https://github.com/equelin/Format-Pester/wiki/Information-for-translators) in the project wiki.
2430

2531
# Requirements
2632

2733
- Powershell v.4.x
2834
- [Pester](https://github.com/pester/Pester)
2935
- [PScribo](https://github.com/iainbrighton/PScribo) - preferred the version >= 0.7.12.47 due to [bug](https://github.com/iainbrighton/PScribo/issues/20)
3036

31-
# Instructions
32-
## Install the module
33-
```powershell
34-
# One time setup with Powershell 5
35-
Install-Module Format-Pester
36-
37-
# Or Manually
38-
# Download the repository
39-
# Unblock the zip
40-
# Extract the Format-Pester folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)
41-
42-
# Import the module
43-
Import-Module Format-Pester #Alternatively, Import-Module \\Path\To\Format-Pester
37+
# Usage
4438

45-
# Get commands in the module
46-
Get-Command -Module Format-Pester
39+
Format-Pester is the PowerShell module so before usage it you need import it - more instruction you can find in [wiki](https://github.com/equelin/Format-Pester/wiki/Importing-Format-Pester).
4740

48-
# Help for commands
49-
Get-Help Format-Pester -Full
41+
## Example 1
42+
```PowerShell
43+
Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text
5044
```
51-
## Online help
52-
You can read [online version of help](/doc/Format-Pester.md) - online help generated by [platyPS module](https://github.com/powershell/platyps)
5345

54-
# Usage
46+
This command will document the results of the Pester's tests. Documents will be store in the current path and they will be available in 3 formats (.html,.docx and .txt).
5547

48+
## Example 2
5649
```PowerShell
57-
Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text
50+
Invoke-Pester -PassThru | Export-Clixml -Path .\Test-Result.xml
51+
52+
Import-Clixml -Path .\Test-Result.xml | Format-Pester -Format .\ -BaseFileName Test-Result -Format HTML -FailedOnly
5853
```
54+
55+
The first command you can run e.g. on a server where PScribo and Format-Pester is not installed. The tests results will be stored in a file as xml representation of object.
56+
57+
After copy the file to the computer where PScribo and Format-Pester are available you can generate report. The html file will be generated with results of failed tests only.
5958

60-
This command will document the results of the Pester's tests. Documents will be store in the current path and they will be available in 3 formats (.html,.docx and .txt).
59+
## Online help
60+
You can read [online version of help](/doc/Format-Pester.md) - online help generated by [platyPS module](https://github.com/powershell/platyps).
6161

62-
# Available functions
62+
# Initial author
6363

64-
- [Format-Pester](/doc/Format-Pester.md)
64+
- Erwan Quélin - [GitHub](https://github.com/equelin) - [Twitter](https://twitter.com/erwanquelin)
6565

6666
# Contributors
6767

6868
- Travis Plunk - [GitHub](https://github.com/TravisEz13) - [Twitter](https://twitter.com/TravisPlunk)
6969
- Wojciech Sciesinski - [GitHub](https://github.com/it-praktyk) - [Twitter](https://twitter.com/ITpraktyk)
7070

71-
# Author
72-
73-
**Erwan Quélin**
74-
- <https://github.com/equelin>
75-
- <https://twitter.com/erwanquelin>
76-
77-
# Information for translators
78-
Format-Pester can be used to prepare reports in languages different than English but a language file for your PSCulture/language need to be available.
79-
80-
To translate required strings to your language please
81-
- read general information about PowerShell support for internationalization
82-
```
83-
Get-Help about_Script_Internationalization
84-
```
85-
online version about_Script_Internationalization available [here](https://technet.microsoft.com/en-us/library/hh847854.aspx).
86-
- create subfolder with your language/culture code under Public - e.g. xx-XX
87-
- copy the file [Format-Pester.psd1](/Public/en-US/Format-Pester.psd1) from Public\en-US\ to your xx-XX - please don't translate module manifest - files have the same name!
88-
- translate required strings
89-
- test - please use Pester, to skip non-translation related tests please use the command
90-
```
91-
Invoke-Pester -Path .\tests\ -Tag Translations
92-
```
93-
you can also uncomment line in the Format-Pester.ps1 file (remember about re-import module with Force)
94-
```
95-
#$LocalizedStrings
96-
```
97-
- use the Language parameter if your PSCulture is different than required language for output
98-
- submit your translation to public repo, pull requests are welcomed
9971

10072
# [Version history](VERSIONS.md)
10173

74+
# [TODO and development plans](TODO.md)
75+
10276
# License
10377
Copyright 2016 Erwan Quelin and the community.
104-
Licensed under the MIT License
78+
Licensed under [the MIT License](LICENSE)
10579

106-
# TODO
107-
- updated examples - align them to v. 1.4.0 and PScribo 0.7.12.47
108-
- update VERSIONS.md
109-
- automate preparing example files

TODO.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# TODO AND DEVELOPMENT PLANS
2+
- add support for NUnit style xml file -> restore PS objects from NUnit https://github.com/pester/Pester/blob/master/Functions/TestResults.ps1#L41
3+
- add support for create separate file by blocks Describe and Context of used/documented tests
4+
- updated examples - align them to v. 1.4.0 and PScribo 0.7.12.47
5+
- update VERSIONS.md
6+
- automate preparing example files

VERSIONS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
## 1.2.0 - 2016-07-20
88

99
## 1.3.0 - 2016-08-14
10-
-
1110

1211
## 1.3.1 - 2016-08-14
1312
- Fix: added explicit Throw for null or empty PesterResult parameter
@@ -22,4 +21,9 @@
2221
- Fix issue #12
2322
- Update
2423
- help: descriptions of INPUTS, OUTPUTS added
25-
- possibility to dump the PScribo Document object added
24+
- possibility to dump the PScribo Document object added
25+
26+
## 1.4.1 - 2016-12-04
27+
- Update
28+
- help: an example added, link to PScribo added
29+
- module manifest: added link to the VERSION.md

0 commit comments

Comments
 (0)