Files
PowerShell-PowerShell/test/xUnit
Travis Plunk 2376e28482 Ensure that socket timeouts are set only during the token validation (#26066)
The main goal is to ensure that socket timeouts are set only during the token validation phase and are properly reset afterward, improving reliability and preventing unintended blocking or premature timeouts in subsequent operations.
2025-09-22 10:56:19 -07:00
..

xUnit Tests

The folder contains xUnit tests for PowerShell Core project.

Running xUnit Tests

Go to the top level of the PowerShell repository and run full set of tests: Start-PSxUnit inside a self-hosted copy of PowerShell.

Go to the test project folder and run dotnet test -c Release.

Use filter parameter to run only needed tests:

dotnet test -c Release --filter "FullyQualifiedName~UnitTest1   # Runs tests which have UnitTest1 in FullyQualifiedName
dotnet test --filter Name~TestMethod1   # Runs tests whose name contains TestMethod1

Creating xUnit Tests

Keep the folder structure that is for Pester ../../test/powershell and C# files ../../src.

Use namespace names started with PSTests.

namespace PSTests.YourNameSpace
{
}