Skip to content

Commit

Permalink
Merge pull request #265 from PlagueHO/Issue-264
Browse files Browse the repository at this point in the history
Prevent unit tests in DSCResource.Tests from running - Fixes #264
  • Loading branch information
PlagueHO committed Sep 2, 2017
2 parents 0a99574 + 00a6bd0 commit b356ba2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Added `Documentation and Examples` section to Readme.md file - see
[issue #259](https://github.com/PowerShell/xNetworking/issues/259).
- Prevent unit tests from DSCResource.Tests from running during test
execution - fixes [Issue #264](https://github.com/PowerShell/xNetworking/issues/264).

## 5.1.0.0

Expand Down
16 changes: 15 additions & 1 deletion Tests/TestHarness.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,21 @@ function Invoke-TestHarness
# DSC Common Tests
if ($PSBoundParameters.ContainsKey('DscTestsPath') -eq $true)
{
$testsToRun += @( $DscTestsPath )
$getChildItemParameters = @{
Path = $DscTestsPath
Recurse = $true
Filter = '*.Tests.ps1'
}

# Get all tests '*.Tests.ps1'.
$commonTestFiles = Get-ChildItem @getChildItemParameters

# Remove DscResource.Tests unit and integration tests.
$commonTestFiles = $commonTestFiles | Where-Object -FilterScript {
$_.FullName -notmatch 'DSCResource.Tests\\Tests'
}

$testsToRun += @( $commonTestFiles.FullName )
}

$results = Invoke-Pester -Script $testsToRun `
Expand Down

0 comments on commit b356ba2

Please sign in to comment.