When contributing to SharePointDsc, you have to make sure unit tests always complete successfully when submitting a Pull Request. The Wiki already contained some commands to run unit tests, but you had to run these manually.
To make running unit tests easier, two scripts have recently been added to the SharePointDsc repository:
- Running unit tests for all resources for a specific version of SharePoint, including code coverage:
.\tests\RunUnitTestsForAllResources.ps1 -SharePointVersion [2013/2016/2019/Subscription] [-DoNotBuildModule]
- Running unit tests for a specific resource for all SharePoint version, including code coverage:
.\tests\RunUnitTestsForResource.ps1 -Resource <Module_Name> [-DoNotBuildModule]
These scripts are located in the tests folder in the repository, the above commands can be executed from the root of the repository on your machine.
Published Feb 10, 2022
Version 1.0Yorick Kuijs
Microsoft
Joined November 07, 2017
SharePointDsc Blog
Follow this blog board to get notified when there's new activity