Fixed unit testissue with build ssytem
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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')
|
||||||
|
|||||||
Reference in New Issue
Block a user