Split the PesterPreference section into the cases it actually covers - #451
Open
nohwnd wants to merge 1 commit into
Open
Split the PesterPreference section into the cases it actually covers#451nohwnd wants to merge 1 commit into
nohwnd wants to merge 1 commit into
Conversation
It was one paragraph covering interactive execution, session defaults and merging with -Configuration all at once, and the only example worked for the first of them. Now each has its own section and its own example. Adds the part that was missing: $PesterPreference set at the top of a test file only applies when you run that file directly, Invoke-Pester ./file.Tests.ps1 ignores it because the run has already started by the time the file is read. Also writes down how the merge works, one option at a time: an option set on the configuration object wins, one that is not set falls back to $PesterPreference, and one set in neither uses its default. Fix #432 🤖
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #432
The
$PesterPreferencesection was one paragraph covering interactive execution, session defaults and merging with-Configurationall at once, and the only example worked for the first of them. Each now has its own section and its own example.Adds the part that was missing, which is the thing that confuses people:
$PesterPreferenceset at the top of a test file only applies when you run that file directly.Invoke-Pester ./file.Tests.ps1ignores it, because the run has already started by the time the file is read.Also writes down how the merge works, one option at a time:
$PesterPreferenceVerified against 6.1.0 rather than written from the source: a session-level
$PesterPreferencewithOutput.Verbosity = 'Detailed'andShould.ErrorAction = 'Continue', plus a configuration object setting onlyOutput.Verbosity = 'Diagnostic', runs withDiagnosticfrom the object andContinuefrom the preference, and leaves the preference object unmodified.🤖