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
This is by design. We evaluate the name just after BeforeEach, so values from BeforeAll and BeforeEach are reflected into the string. This seemed like the best place, since the Before* steps are setting up values and should hopefully have all the right data for the test.
We also need to evaluate in a scope that is on the same level as the BeforeEach.
The code here could probably be changed to capture the error from BeforeEach, run more code to evaluate the name of the test, and rethrow the error.
The variables are expanded after setup (BeforeAll/-Each) to have all variables/reference available. An exception during setup stops further processing to avoid unexpected results like old variables from parent scope being used etc.
@nohwnd Candidate for v6? Does anyone depend on BeforeEach/-All variables for templates?
I built a framework that can parse configuration files to pester tests. In it there is an option to specifiy if a test is terminating or not.
As you can use Set-ItResult (or its errorrecord) within BeforeEach the tests get the correct state but their title is not set correctly.
The variables might still be present (especially when coming from the testdata) and one could atleast try to expand them.
Edit:
Another case in which the above happens is when the Test is skipped via the -Skip parameter
Checklist
What is the issue?
Output does not resolve the current item
$_
in the output.Expected Behavior
Steps To Reproduce
Describe your environment
Possible Solution?
No response
The text was updated successfully, but these errors were encountered: