PowerShell / DscResources

Central repository for PowerShell Desired State Configuration (DSC) resources.
http://blogs.msdn.com/b/powershell/
MIT License
776 stars 205 forks source link

Add Best Practice around Pester Parameters for It and Context #473

Closed PlagueHO closed 5 years ago

PlagueHO commented 5 years ago

We should add guidelines around "It" and "Context" blocks. This could be an best practice as I know many repos don't do this (many of mine don't).

It description should begin with 'Should'. E.g. It 'Should return $true'

Context description should begin with 'When'. E.g. Context 'When the website exists'

@johlju - your thoughts? I'm happy to submit if the community agrees.

johlju commented 5 years ago

My though was that the template showed that; https://github.com/PowerShell/DscResources/blob/master/Tests.Template/unit_template.ps1 But a template is not the same as a guideline, so I see no problem by adding that. To the Best Practices section Pester Tests maybe?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

johlju commented 5 years ago

Kicking the stale bot as this is something we should add.

PlagueHO commented 5 years ago

I'll get onto this.