|
Hi, More detailed: To solve it I implemented a Factory module that gets the test name and returns the test object. In general I would like to move BaseTest implementation to a .tests file and inherit it (Is it the correct way?). |
Replies: 2 comments 1 reply
|
Do you a have an example with more details (but hopefully small example without too many details)? |
|
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 |
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 useBeforeAll/BeforeEachon a parentDescribeorContextso nested tests inherit the setup. For running the same steps over many inputs use-ForEachonDescribe/Context/It, orNew-PesterContainer -Data.