42 lines
1.2 KiB
PowerShell
42 lines
1.2 KiB
PowerShell
BeforeAll {
|
|
$Repo = Get-RepoPath
|
|
Import-Module $Repo.Src.Manifest.Item.FullName -Force
|
|
}
|
|
Describe 'Send-PRComment' {
|
|
Context 'Default tests' -Tag 'Default' {
|
|
It 'Test Function' {
|
|
{ Get-Command -Name 'Send-PRComment' -Module $Repo.Artifact } | Should -Not -Throw
|
|
}
|
|
|
|
It 'Test Help' {
|
|
{ Get-Help -Name 'Send-PRComment' } | Should -Not -Throw
|
|
}
|
|
|
|
It 'Help Content' {
|
|
$foo = Get-Help -Name 'Send-PRComment'
|
|
$foo.Synopsis.Length | Should -BeGreaterThan 5
|
|
$foo.Description.Count | Should -BeGreaterOrEqual 1
|
|
$foo.Description[0].Text.Length | Should -BeGreaterThan 5
|
|
}
|
|
}
|
|
|
|
Context 'Unit tests' -Tag 'Unit' {
|
|
It 'Should throw' {
|
|
{ Send-PRComment -foo } | Should -Throw
|
|
}
|
|
#
|
|
#It 'Should not throw' {
|
|
#Mock 'FunctionName' -ModuleName $Repo.Artifact {}
|
|
# { Send-PRComment } | Should -Not -Throw
|
|
#}
|
|
}
|
|
|
|
<#
|
|
Context 'Integration tests' -Tag 'Integration' {
|
|
It 'Real world example' {
|
|
{ Send-PRComment } | Should -Should -Be $null
|
|
}
|
|
}
|
|
#>
|
|
}
|