Skip to content

Commit 27b5b78

Browse files
committed
✅ Add Unit Tests
1 parent 0fe4a1e commit 27b5b78

7 files changed

Lines changed: 31 additions & 51 deletions

File tree

PSGitChangeLog/Public/Get-GitTagList.Tools.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.EXAMPLE
77
Get-GitTagList -TagPrefix plumber -Latest
88
.EXAMPLE
9-
Get-GitTagList
9+
Get-GitTagList -TagPrefix ''
1010
#>
1111
Param (
1212
[string]

Publish-ToPSGallery.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Param (
22
$nuGetApiKey = $env:PSGallery_PAT
3+
,
4+
$moduleVersion = $env:Gitversion_SemVerId
35
)
46
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
57

68
$releaseNotes = $env:RELEASE_NOTES
7-
$moduleVersion = $env:Gitversion_SemVerId
9+
810
Write-Host "ModuleVersion: $moduleVersion"
911

1012
$manifestPath = Resolve-Path -Path "*\*.psd1"

Tests/.Project.Tests.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $projectRoot = Resolve-Path "F:\rdcinmotiv\Plumber\Tests\.."
1+
22
$projectRoot = Resolve-Path "$PSScriptRoot\.."
33
$moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psm1")
44
$moduleName = Split-Path $moduleRoot -Leaf
@@ -23,7 +23,6 @@ Describe "PSScriptAnalyzer rule-sets" -Tag Build {
2323
$message = "{0} Line {1}: {2}" -f $rule.Severity, $rule.Line, $rule.message
2424
$message | Should -Be ""
2525
}
26-
2726
}
2827
} else {
2928
It "Should not fail any rules" {

Tests/TestSets/Environments.csv

Lines changed: 0 additions & 7 deletions
This file was deleted.

Tests/TestSets/TokenizeThis.ps1

Lines changed: 0 additions & 28 deletions
This file was deleted.

Tests/TestSets/kettle.properties

Lines changed: 0 additions & 12 deletions
This file was deleted.

Tests/Unit.Tests.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# $projectRoot = Resolve-Path "F:\rdcinmotiv\Plumber\Tests\.."
2+
. $PSScriptRoot\TestHeader.Template.ps1
3+
4+
Describe "Test-IssueKey" -Tag Unit {
5+
$keys = @('ISSUE-1','ISSUE-1213','KEY-23')
6+
$keys | ForEach-Object {
7+
it "$_ in a commit message should be parsed as a key" {
8+
$key = Test-IssueKey("Commit message mentions $_ somwhere ")
9+
$key | Should -Be $_
10+
}
11+
}
12+
13+
}
14+
15+
Describe Get-GitHistory {
16+
$result = Get-GitHistory -OutputAs psobject
17+
it 'should return results' {
18+
$result | Should -Not -Be $null
19+
}
20+
it 'Results should have release' {
21+
$result.Release | Should -Not -Be $null
22+
}
23+
it 'Results should have intents' {
24+
$result.intent | Should -Not -Be $null
25+
}
26+
}

0 commit comments

Comments
 (0)