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

Parametric scripts #1671

Merged
merged 13 commits into from
Sep 4, 2020
Merged

Parametric scripts #1671

merged 13 commits into from
Sep 4, 2020

Conversation

nohwnd
Copy link
Member

@nohwnd nohwnd commented Sep 2, 2020

Add the ability to provide parameters to scripts via Invoke-Pester.

Fix #1485
Fix #1558

@nohwnd
Copy link
Member Author

nohwnd commented Sep 2, 2020

This is how it would be used, you can provide one or multiple of those objects, and one or multiple sets of data in each objects:

https://github.com/pester/Pester/pull/1671/files#diff-cde464fba76b676794f7d9560b6443acR571-R575

You'd be most likely providing files, not scriptblocks.

@@ -368,3 +368,22 @@ function Remove-RSpecNonPublicProperties ($run){
$i.PluginData = $null
}
}


function New-TestContainer {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this good API?

@@ -288,6 +288,9 @@ function Invoke-Pester {
[Parameter(ParameterSetName = "Legacy")] # Legacy set for v4 compatibility during migration - deprecated
[Switch] $PassThru,

[Parameter(ParameterSetName = "Simple")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this good API?

@nohwnd
Copy link
Member Author

nohwnd commented Sep 3, 2020

@JustinGrote review pls :)

@nohwnd nohwnd merged commit fa7081d into v5.0 Sep 4, 2020
@nohwnd nohwnd deleted the parametric-scripts-and-blocks branch September 4, 2020 14:34
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.

Reimplementation: Param Blocks in Tests v5: Parametrized scripts are not implemented
1 participant