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

Published Feb 10 2022 05:15 AM 1,164 Views
Microsoft

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.

Co-Authors
Version history
Last update:
‎Feb 10 2022 05:15 AM
Updated by: