-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathupdate-changelog.Tests.ps1
More file actions
51 lines (42 loc) · 2.26 KB
/
Copy pathupdate-changelog.Tests.ps1
File metadata and controls
51 lines (42 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Describe 'update-changelog' {
It '<_>' -ForEach @(Get-ChildItem "$PSScriptRoot/testdata/changelog/") {
$testCase = $_
Copy-Item "$testCase/CHANGELOG.md.original" "$testCase/CHANGELOG.md"
pwsh -WorkingDirectory $testCase -File "$PSScriptRoot/../scripts/update-changelog.ps1" `
-Name 'Dependency' `
-PR 'https://github.com/getsentry/dependant/pulls/123' `
-RepoUrl 'https://github.com/getsentry/dependency' `
-MainBranch 'main' `
-OldTag '7.16.0' `
-NewTag '7.17.0' `
-Section 'Dependencies'
Get-Content "$testCase/CHANGELOG.md" | Should -Be (Get-Content "$testCase/CHANGELOG.md.expected")
}
It 'should correctly detect bullet points when plain text appears before bullet points' {
$testCasePath = "$PSScriptRoot/testdata/changelog/plain-text-intro"
Copy-Item "$testCasePath/CHANGELOG.md.original" "$testCasePath/CHANGELOG.md"
pwsh -WorkingDirectory $testCasePath -File "$PSScriptRoot/../scripts/update-changelog.ps1" `
-Name 'Dependency' `
-PR 'https://github.com/getsentry/dependant/pulls/123' `
-RepoUrl 'https://github.com/getsentry/dependency' `
-MainBranch 'main' `
-OldTag '7.16.0' `
-NewTag '7.17.0' `
-Section 'Dependencies'
# verify the full output matches expected
Get-Content "$testCasePath/CHANGELOG.md" | Should -Be (Get-Content "$testCasePath/CHANGELOG.md.expected")
}
It 'should handle changelogs with no bullet points by defaulting to dash' {
$testCasePath = "$PSScriptRoot/testdata/changelog/no-bullet-points"
Copy-Item "$testCasePath/CHANGELOG.md.original" "$testCasePath/CHANGELOG.md"
pwsh -WorkingDirectory $testCasePath -File "$PSScriptRoot/../scripts/update-changelog.ps1" `
-Name 'Dependency' `
-PR 'https://github.com/getsentry/dependant/pulls/123' `
-RepoUrl 'https://github.com/getsentry/dependency' `
-MainBranch 'main' `
-OldTag '7.16.0' `
-NewTag '7.17.0' `
-Section 'Dependencies'
Get-Content "$testCasePath/CHANGELOG.md" | Should -Be (Get-Content "$testCasePath/CHANGELOG.md.expected")
}
}