[Announcement] Making running unit tests easier for contributing to SharePointDsc

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

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:

  1. Running unit tests for all resources for a specific version of SharePoint, including code coverage:.\tests\RunUnitTestsForAllResources.ps1 -SharePointVersion [2013/2016/2019/Subscription] [-DoNotBuildModule]
  2. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.