PowerShell/test/powershell
Andrew Schwartzmeyer d59710d310 Remove unimplemented Management cmdlets from Unix
These are not currently implemented and so should not show up as
available.

The *-Computer cmdlets are already not compiled for Unix (and so not
available), so let's not declare them in the manifest.

The Get-ComputerInfo cmdlet does not work on Unix and so should not be
made available.

Test-Connection depends on an unavailable WMI provider.

Get/Set-TimeZone are not yet ported.
2016-08-09 18:54:05 -07:00
..
engine Fix issue #1609 - Get-PSSession -computername fails on nano 2016-08-05 11:20:14 -07:00
enginecore Merge pull request #1641 from PowerShell/LanguagePrimitiveTest 2016-08-09 12:14:02 -07:00
Host Revert "Merge pull request #1458 from PowerShell/psedition_rename" 2016-08-03 15:53:31 -07:00
Language Skip $input type test per #1563 2016-07-28 18:02:24 -07:00
Modules Remove unimplemented Management cmdlets from Unix 2016-08-09 18:54:05 -07:00
Scripting/NativeExecution Add tests for Error stream 2016-08-01 18:40:51 -07:00
SDK make sure that all tests are using the proper $IsCoreCLR variable instead of $IsCore 2016-07-27 12:32:17 -07:00
README.md

Pester Testing Test Guide

Also see the Pester Do and Don't document.

Running Pester Tests

Go to the top level of the PowerShell repository and run: Start-PSPester inside a self-hosted copy of PowerShell.

You can use Start-PSPester -Tests SomeTestSuite* to limit the tests run.

Testing new powershell processes

Any launch of a new powershell process must include -noprofile so that modified user and system profiles do not causes tests to fail. You also must take care to call the development copy of PowerShell, which is not the first one on the path.

Example:

    $powershell = Join-Path -Path $PsHome -ChildPath "powershell"
    & $powershell -noprofile -command "ExampleCommand" | Should Be "ExampleOutput"

Portability

Some tests simply must be tied to certain platforms. Use Pester's -Skip directive on an It statement to do this. For instance to run the test only on Windows:

It "Should do something on Windows" -Skip:($IsLinux -Or $IsOSX) { ... }

Or only on Linux and OS X:

It "Should do something on Linux" -Skip:$IsWindows { ... }

Pending

When writing a test that should pass, but does not, please do not skip or delete the test, but use It "Should Pass" -Pending to mark the test as pending, and file an issue on GitHub.