You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -285,7 +285,7 @@ A `BeforeDiscovery` block inside the `Describe` is the tidier home for the same
285
285
286
286
Pester reads a test file twice. First it **discovers** the tests: it runs the file top to bottom, evaluates every `Describe`, `Context` and `It`*header*, and builds the tree. Only then does it **run** the tests: the `BeforeAll`, `BeforeEach`, `It` and `AfterAll`*bodies*.
287
287
288
-
Anything a header needs - `-Skip:`, `-ForEach`, the test name - has to exist at discovery time. Anything a body needs has to exist at run time. The two do not share variables, and this is the single biggest source of confusion left over from Pester v4.
288
+
Anything a header needs - `-Skip:`, `-ForEach`, the test name - has to exist at discovery time. Anything a body needs has to exist at run time. The two do not share variables, and this is the single biggest source of confusion when writing a test file.
289
289
290
290
`BeforeDiscovery` is the block for discovery-time code. It keeps that code out of the `Describe` body while still running early enough:
Write-Host-Object "appveyor.pester: Running with Pester Version $((Get-CommandInvoke-Pester-ErrorAction SilentlyContinue).Version)"-ForegroundColor DarkGreen
392
394
393
395
# invoking a single invoke-pester consumes too much memory, let's go file by file
0 commit comments