-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Error in BeforeAll of Data driven tests leads to missing info in the error output #2571
Comments
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. https://github.com/pester/Pester/blob/main/src/Pester.Runtime.ps1#L643 |
This is known limitation and currently by design. The variables are expanded after setup ( @nohwnd Candidate for v6? Does anyone depend on |
IDK if we technically we can fix it. There can also be a different complaint which is: the variables from my tests / AfterAll are not expanded. |
Chiming in on this topic: 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. The variables might still be present (especially when coming from the testdata) and one could atleast try to expand them. Edit: |
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: