Repository navigation
Clean up test code to use -Parameter syntax for Pester tests #6245
Copy link
Copy link
Closed
Labels
Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityIssue-Metaan issue used to track multiple issuesan issue used to track multiple issuesResolution-FixedThe issue is fixed.The issue is fixed.
Description
Pester documentation for 4.x recommends using Should -Be instead of Should Be syntax. We should update all our tests and documentation to adhere to this setting a good example for the community.
- engine Use new Pester syntax: -Parameter for Pester tests in engine. #6298
- Host Upgrade Pester tests in test\powershell\Host folder to dashed v4 syntax #6250
- Installer Upgrade Pester tests in test\powershell\Host folder to dashed v4 syntax #6250
- Language Use new Pester syntax: -Parameter for Pester tests in Language. #6304
- Modules/CimCmdlets Use new Pester syntax: -Parameter for Pester tests in Modules/CimCmdlets #6306
- Microsoft.PowerShell.Core Use new Pester syntax: -Parameter for Pester tests in Modules/Microsoft.PowerShell.Core. #6349
- Microsoft.PowerShell.Diagnostics Use new Pester syntax: -Parameter for Pester tests in Modules/Microsoft.PowerShell.Diagnostics. #6351
- Microsoft.Powershell.Host Upgrade Pester tests in test\powershell\Host folder to dashed v4 syntax #6250
- Microsoft.PowerShell.LocalAccounts WIP: Use new Pester syntax: -Parameter for Modules/Microsoft.PowerShell.LocalAccounts tests #6499
- Microsoft.PowerShell.Management Use new Pester syntax: -Parameter for Pester tests in Microsoft.PowerShell.Management module. #6294
- Microsoft.PowerShell.Security Upgrade Pester tests in Microsoft.PowerShell.Security folder to dashed v4 syntax #6256
- Microsoft.PowerShell.Utility Use new Pester syntax: -Parameter for Pester tests in modules: Microsoft.PowerShell.Utility and Microsoft.WSMan.Management. #6366
- Microsoft.PowerShell.Utility Web Refactor Web Cmdlets Tests to Pester 4 Syntax #6257
- Microsoft.WSMan.Management Use new Pester syntax: -Parameter for Pester tests in modules: Microsoft.PowerShell.Utility and Microsoft.WSMan.Management. #6366
- PackageManagement Use new Pester syntax: -Parameter for Pester tests in modules: PowerShellGet, PackageManagement, PSReadLine #6488
- Modules/PowerShellGet Use new Pester syntax: -Parameter for Pester tests in modules: PowerShellGet, PackageManagement, PSReadLine #6488
- Modules/PSDesiredStateConfiguration Use new Pester syntax: -Parameter for Pester tests in module PSDesiredStateConfiguration #6622
- Modules/PSReadLine Use new Pester syntax: -Parameter for Pester tests in modules: PowerShellGet, PackageManagement, PSReadLine #6488
- Provider Use new Pester syntax: -Parameter for Pester in SDK and Provider tests #6490
- SDK Use new Pester syntax: -Parameter for Pester in SDK and Provider tests #6490
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityIssue-Metaan issue used to track multiple issuesan issue used to track multiple issuesResolution-FixedThe issue is fixed.The issue is fixed.
Activity
iSazonov commentedon Feb 26, 2018
Maybe Meta-Issue? I'd rather break the work apart otherwise we'll get a huge size PR which is hard to review.
I guess Mark Kraus (@markekraus) grabs web cmdlet tests. I could grab something else, rest utility cmdlet tests.
markekraus commentedon Feb 26, 2018
hehe I planned to do this with the web cmdlet tests, yes.
SteveL-MSFT commentedon Feb 26, 2018
Ilya (@iSazonov) breaking it up makes sense!
bergmeister commentedon Feb 26, 2018
I haven't tried it yet but here is a helper script to help with with upgrading to the new syntax. I have seen it being used by the xDFS repo already.
PowerShell#6245 refactor all Pester tests to use v4 Should syntax
PowerShell#6245 refactor all PackageManagement Pester tests to use v4…
PowerShell#6245 refactor PSReadLine Pester tests to use v4 Should syntax
PowerShell#6245 refactor SDK and Provider Pester tests to use v4 Shou…
KevinMarquette commentedon Mar 24, 2018
I have a PR out for these items on the list:
PowerShellGet, PackageManagement, PSReadLine #6488
SDK and Provider tests #6490
KevinMarquette commentedon Mar 26, 2018
I have a PR out for the LocalAccounts module #6499
xtqqczze commentedon Jan 10, 2020
#6499 was not merged
xtqqczze commentedon Jan 10, 2020
Ilya (@iSazonov) Can you reopen?
iSazonov commentedon Jan 10, 2020
xtqqczze The Microsoft.PowerShell.LocalAccounts module was removed from PowerShell Core.
xtqqczze commentedon Jan 10, 2020
Ilya (@iSazonov) There is an issue to remplement (#4305) so we should still update pester syntax.
iSazonov commentedon Jan 10, 2020
xtqqczze It is impossible to get Microsoft.PowerShell.LocalAccounts module based on other API. We have to implement new module and new tests. (See my WIP PR for AccountManagement module)