Skip to content
Discussion options

You must be logged in to vote

Pester has no inheritance, there are no test classes to derive from. The blocks are just scriptblocks that run.

What you can do is put the shared code in a helper module and import it in BeforeAll, and use BeforeAll / BeforeEach on a parent Describe or Context so nested tests inherit the setup. For running the same steps over many inputs use -ForEach on Describe / Context / It, or New-PesterContainer -Data.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@JustinGrote
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by nohwnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants