Fixed unit testissue with build ssytem

This commit is contained in:
KevinMarquette
2017-02-05 01:19:55 -08:00
parent 2810686181
commit 1d047b5f14
2 changed files with 5 additions and 3 deletions

View File

@@ -61,8 +61,10 @@ Describe "Basic unit tests" -Tags Build {
} }
it "SetScript()" { it "SetScript()" {
pushd $projectRoot
$monitor = [MonitoredScript]::New() $monitor = [MonitoredScript]::New()
{$monitor.SetScript("$projectRoot\scratchfiles\example.ps1")} | Should Not Throw {$monitor.SetScript(".\scratchfiles\example.ps1")} | Should Not Throw
popd
} }
} }

View File

@@ -33,7 +33,7 @@ Task Init {
Task UnitTests -Depends Init { Task UnitTests -Depends Init {
$lines $lines
'Running quick unit tests to fail early if there is an error' 'Running quick unit tests to fail early if there is an error'
$TestResults = Invoke-Pester -Path $ProjectRoot\Tests\*unit* -PassThru -Tag Build -Show Failed $TestResults = Invoke-Pester -Path $ProjectRoot\Tests\*unit* -PassThru -Tag Build
if($TestResults.FailedCount -gt 0) if($TestResults.FailedCount -gt 0)
{ {
@@ -47,7 +47,7 @@ Task Test -Depends UnitTests {
"`n`tSTATUS: Testing with PowerShell $PSVersion" "`n`tSTATUS: Testing with PowerShell $PSVersion"
# Gather test results. Store them in a variable and file # Gather test results. Store them in a variable and file
$TestResults = Invoke-Pester -Path $ProjectRoot\Tests -PassThru -OutputFormat NUnitXml -OutputFile "$ProjectRoot\$TestFile" -Tag Build -Show Failed $TestResults = Invoke-Pester -Path $ProjectRoot\Tests -PassThru -OutputFormat NUnitXml -OutputFile "$ProjectRoot\$TestFile" -Tag Build
# In Appveyor? Upload our tests! #Abstract this into a function? # In Appveyor? Upload our tests! #Abstract this into a function?
If($ENV:BHBuildSystem -eq 'AppVeyor') If($ENV:BHBuildSystem -eq 'AppVeyor')