Clean up Pester tests
This commit is contained in:
23
Tests/Get-Chronometer.Tests.ps1
Normal file
23
Tests/Get-Chronometer.Tests.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
Describe "Function: Get-Chronometer" -Tag Build {
|
||||
It "Does not throw" {
|
||||
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
|
||||
{Get-Chronometer -Path $PSScriptRoot\..\ScratchFiles\example.ps1 -Script {"Test"} } | Should Not Throw
|
||||
}
|
||||
|
||||
It "Executes a script and gives results" {
|
||||
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
|
||||
$results = Get-Chronometer -Path $PSScriptRoot\..\ScratchFiles\example.ps1 -Script {. "$PSScriptRoot\..\ScratchFiles\example.ps1"}
|
||||
$results | Should Not BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "Executes a script with linenumbers and gives results" {
|
||||
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
|
||||
$params = @{
|
||||
Path = "$PSScriptRoot\..\ScratchFiles\example.ps1"
|
||||
Script = {. "$PSScriptRoot\..\ScratchFiles\example.ps1"}
|
||||
LineNumber = 2,3,5,6
|
||||
}
|
||||
$results = Get-Chronometer @params
|
||||
$results | Should Not BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user