KevinMarquette / PlasterTemplates

A set of Plaster templates that I use.
MIT License
37 stars 9 forks source link

Fix: module *dependencies* should be removed on cleanup #10

Closed christianacca closed 6 years ago

christianacca commented 6 years ago

New Unload-SUT function

Cleanup logic should remove not only the module built/tested but also any dependent modules. Not doing so can result in failures when PS tries to load multiple instances of a module (eg when that module exposes types).

test.depend.psd1 defines all dependencies of the SUT. A new Unload-SUT function uses this to generically unload all modules necessary.

Cleanup after all testcases

Is best practice that after a test run, to cleanup by removing SUT modules. This is achieved by adding an AfterAll code block to each test file

Cleanup module.build.ps1

Now that loading/unloading is handled by each test, the ImportModule task is no longer necessarily