-
I've searched this both on google and in the Discussions here, but cannot find a definitive answer. I'm creating some tests for some internal PoSh modules that we've written. There's no plans (currently) to have any Jenkins/AzDo pipeline for running the tests (for reasons I won't get into here). Instead people will run the tests locally. We're generating code coverage using CoverageGutters and using the vscode plug-in to see the code coverage within the module files (which works really well) Currently in order to generate code coverage, we have to do something like
Rather than have to tell people to do this via the README, is there any way that this configuration can be stored within the .Tests.ps1 file ? I've tried adding it to the top of the file, and I've also tried adding it to the BeforeDiscovery block but neither seem to have any effect. I could add this to a RunPesterTests.ps1 but I'd like to avoid that if possible :-) Thanks in advance for any advice |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is no way to do this. Pester configuration is picked up once (on purpose) to avoid every file defining its own that we would then have hard time merging, especially if that is a "global" setting like code coverage that potentially applies to multiple files. |
Beta Was this translation helpful? Give feedback.
There is no way to do this. Pester configuration is picked up once (on purpose) to avoid every file defining its own that we would then have hard time merging, especially if that is a "global" setting like code coverage that potentially applies to multiple files.