Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve descriptions for PesterConfiguration sections #2505

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/Pester.Runtime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,6 @@ function Test-ShouldRun {
if ($l -eq $line) {
if ($PesterPreference.Debug.WriteDebugMessages.Value) {
Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is excluded, because its path:line '$line' matches line filter '$excludeLineFilter'."
Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is explicitly excluded, because it matched line filter, and will run even if -Skip is specified on it. Any skipped children will still be skipped."
}
$result.Exclude = $true
$result.Explicit = $true
Expand All @@ -1790,16 +1789,10 @@ function Test-ShouldRun {
if ($l -eq $line) {
if ($PesterPreference.Debug.WriteDebugMessages.Value) {
Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is included, because its path:line '$line' matches line filter '$lineFilter'."
}

# if ('Test' -eq $Item.ItemType ) {
if ($PesterPreference.Debug.WriteDebugMessages.Value) {
Write-PesterDebugMessage -Scope Filter "($fullDottedPath) $($Item.ItemType) is explicitly included, because it matched line filter, and will run even if -Skip is specified on it. Any skipped children will still be skipped."
}

$result.Explicit = $true
# }

$result.Include = $true
return $result
}
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/CodeCoverageConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static CodeCoverageConfiguration ShallowClone(CodeCoverageConfiguration c
{
return Cloner.ShallowClone(configuration);
}
public CodeCoverageConfiguration() : base("CodeCoverage configuration.")
public CodeCoverageConfiguration() : base("Options to enable and configure Pester's code coverage feature.")
{
Enabled = new BoolOption("Enable CodeCoverage.", false);
OutputFormat = new StringOption("Format to use for code coverage report. Possible values: JaCoCo, CoverageGutters", "JaCoCo");
Expand Down
4 changes: 2 additions & 2 deletions src/csharp/Pester/FilterConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public FilterConfiguration(IDictionary configuration) : this()
configuration.AssignArrayIfNotNull<string>(nameof(FullName), v => FullName = v);
}
}
public FilterConfiguration() : base("Filter configuration")
public FilterConfiguration() : base("Filter options to include/exclude tests and blocks in the targeted containers using tags, name or location. Include by default when no include filters are provided. Exclude filters take precedence.")
{
Tag = new StringArrayOption("Tags of Describe, Context or It to be run.", new string[0]);
ExcludeTag = new StringArrayOption("Tags of Describe, Context or It to be excluded from the run.", new string[0]);
Line = new StringArrayOption(@"Filter by file and scriptblock start line, useful to run parsed tests programmatically to avoid problems with expanded names. Example: 'C:\tests\file1.Tests.ps1:37'", new string[0]);
Line = new StringArrayOption(@"Filter by file and scriptblock start line, useful to run parsed tests programmatically to avoid problems with expanded names. Explicit filter that overrides -Skip. Example: 'C:\tests\file1.Tests.ps1:37'", new string[0]);
ExcludeLine = new StringArrayOption("Exclude by file and scriptblock start line, takes precedence over Line.", new string[0]);
FullName = new StringArrayOption("Full name of test with -like wildcards, joined by dot. Example: '*.describe Get-Item.test1'", new string[0]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/OutputConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public OutputConfiguration(IDictionary configuration) : this()
}
}

public OutputConfiguration() : base("Output configuration")
public OutputConfiguration() : base("Options to customize the console output generated by Pester.")
{
Verbosity = new StringOption("The verbosity of output, options are None, Normal, Detailed and Diagnostic.", "Normal");
StackTraceVerbosity = new StringOption("The verbosity of stacktrace output, options are None, FirstLine, Filtered and Full.", "Filtered");
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/RunConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public RunConfiguration(IDictionary configuration) : this()
}
}

public RunConfiguration() : base("Run configuration.")
public RunConfiguration() : base("General runtime options for Pester including tests containers to execute.")
{
Path = new StringArrayOption("Directories to be searched for tests, paths directly to test files, or combination of both.", new string[] { "." });
ExcludePath = new StringArrayOption("Directories or files to be excluded from the run.", new string[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/ShouldConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static ShouldConfiguration ShallowClone(ShouldConfiguration configuration
return Cloner.ShallowClone(configuration);
}

public ShouldConfiguration() : base("Should configuration.")
public ShouldConfiguration() : base("Options to control the behavior of the Pester's Should assertions.")
{
ErrorAction = new StringOption("Controls if Should throws on error. Use 'Stop' to throw on error, or 'Continue' to fail at the end of the test.", "Stop");
DisableV5 = new BoolOption("Disables usage of Should -Be assertions, that are replaced by Should-Be in version 6.", false);
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/TestDriveConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static TestDriveConfiguration ShallowClone(TestDriveConfiguration configu
{
return Cloner.ShallowClone(configuration);
}
public TestDriveConfiguration() : base("TestDrive configuration.")
public TestDriveConfiguration() : base("Options to configure the TestDrive feature.")
{
Enabled = new BoolOption("Enable TestDrive.", true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/TestRegistryConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static TestRegistryConfiguration ShallowClone(TestRegistryConfiguration c
{
return Cloner.ShallowClone(configuration);
}
public TestRegistryConfiguration() : base("TestRegistry configuration.")
public TestRegistryConfiguration() : base("Options to configure the TestRegistry feature. TestRegistry is only available on Windows-systems.")
{
Enabled = new BoolOption("Enable TestRegistry.", true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/Pester/TestResultConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static TestResultConfiguration ShallowClone(TestResultConfiguration confi
return Cloner.ShallowClone(configuration);
}

public TestResultConfiguration() : base("TestResult configuration.")
public TestResultConfiguration() : base("Export options to output Pester's testresult to knwon file formats like NUnit and JUnit XML.")
{
Enabled = new BoolOption("Enable TestResult.", false);
OutputFormat = new StringOption("Format to use for test result report. Possible values: NUnitXml, NUnit2.5, NUnit3 or JUnitXml", "NUnitXml");
Expand Down