GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Updated Pester Syntax in Writing Tests Guide by markwragg · Pull Request #8039 · PowerShell/PowerShell Conversation
|
|
|
||
| #### Describe | ||
| Creates a logical group of tests. All Mocks and TestDrive contents defined within a Describe block are scoped to that Describe; they will no longer be present when the Describe block exits. A `Describe block may contain any number of Context and It blocks. | ||
| Creates a logical group of tests. All Mocks and TestDrive contents defined within a Describe block are scoped to that Describe; they will no longer be present when the Describe block exits. A Describe block may contain any number of Context and It blocks. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it should be - A `Describe` block
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| The DESCRIBE BeforeAll block is executed before any other code even though it was at the bottom of the Describe block, so if state is set elsewhere in the describe BLOCK, that state will not be visible (as the code will not yet been run). Notice, too, that the BEFOREALL block in Context is executed before any other code in that block. | ||
| Generally, you should have code reside in one of the code block elements of `[Before|After][All|Each]`, especially if those block rely on state set by free code elsewhere in the block. | ||
| The Describe BeforeAll block is executed before any other code even though it was at the bottom of the Describe block, so if state is set elsewhere in the describe BLOCK, that state will not be visible (as the code will not yet been run). Notice, too, that the BeforeAll block in Context is executed before any other code in that block. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
`Describe` `BeforeAll`
BLOCK -> block
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
You also have spelling issues. I filed the following issue on the spelling tests: #8078 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-Authored-By: markwragg <[email protected]>
Co-Authored-By: markwragg <[email protected]>
Co-Authored-By: markwragg <[email protected]>
|
The PR is still failing the spelling check. FYI, I'm out of the office for the next week and will be checking GitHub less frequently. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It's hard to tell from the spelling test output which specific words it's failing on, but to me it looks like in each case it's Pester domain-specific words like I'm pretty sure this PR has not introduced any new spelling mistakes, and I think it is an improvement on the previous version of this page, so my suggestion would be to merge it and iterate with further versions for other improvements. If you can provide more specifics on spellings that you want edited however I'm happy to implement. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Mark Wragg (@markwragg) Please replace ' with backstick. It'll resolve all issues. 'RequireAdminOnWindows' -> `RequireAdminOnWindows` |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
just a couple things, but important (i think)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| It "1 is really an int" { | ||
| $i = 1 | ||
| $i.GetType() | Should Be "int" | ||
| $i.GetType() | Should -BeExactly "int" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this should really be:
$i | Should -BeOfType [int]
and consistent with the next change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Doing this then makes this example a duplicate of the one that follows it. Should we just remove this example instead of we don't want to recommend checking types this way?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
restarted macOS CI |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
review is out of date
|
Mark Wragg (@markwragg) Thanks for your contribution! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Modified the Pester syntax for the `-Be` assertion (instead of just `Be`) to reflect the preferred use per latest version of Pester. - Added an example showing use of `-BeOfType` to test the type of a variable. - Other minor changes for grammar.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.