Skip to content
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

Add missing container-parameters to Data before BeforeDiscovery #2361

Merged
merged 1 commit into from Jun 7, 2023

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented Jun 5, 2023

PR Summary

Add default values for unused script parameters to container's Data before executing BeforeDiscovery. Avoids changes to the variables in BeforeDiscover from being captured and sent to Run-phase.

Known limitation: Changing the variable outside BeforeDiscovery/Describe/Context would still modify it in Data. Can't fix as we don't have a hook to execute code before it. Root-level code is also discouraged in Pester v5.

Fix #2359

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
    • If not, use the arrow next to Create Pull Request to mark it as a draft. PR can be marked Ready for review when it's ready.
  • Tests are added/update (if required)
  • Documentation is updated/added (if required)

@fflaten fflaten changed the title Add missing contianer-parameters to Data before BeforeDiscovery Add missing container-parameters to Data before BeforeDiscovery Jun 5, 2023
@nohwnd nohwnd merged commit 96da478 into pester:main Jun 7, 2023
14 checks passed
@fflaten fflaten deleted the fix-containerdata branch June 7, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changes to undefined script parameters during BeforeDiscovery are added to Data
2 participants