This repository has been archived by the owner on Dec 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Tests.ps1
41 lines (33 loc) · 1.43 KB
/
Tests.ps1
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
# Install-Module -Repository PSGallery -Scope CurrentUser -Force -Name Pester, PSScriptAnalyzer -SkipPublisherCheck
$env:TESTS = $true
. (Join-Path $PSScriptRoot 'Entrypoint.ps1')
describe 'Helper functoins test' {
it 'Parse issue title' {
@(
@('xmake@2.2.7: extract_dir error', 'xmake', '2.2.7', 'extract_dir error'),
@('IntelliJ-IDEA-Ultimate-EAP-portable@2019.2-192.5281.24: hash check failed', 'IntelliJ-IDEA-Ultimate-EAP-portable', '2019.2-192.5281.24', 'hash check failed')
) | ForEach-Object {
Resolve-IssueTitle $_[0] | Should -Be $_[1], $_[2], $_[3]
}
Resolve-IssueTitle 'šěš@:alfa' | Should -Be $null, $null, $null
}
it 'Checklist' {
$trues = @(
@('Alfa', $true),
@('BETA', $true),
@('COSI', $true)
)
$falses = @(
@('Alfa', $false),
@('BETA', $false),
@('COSI', $false)
)
$trues | ForEach-Object { New-CheckListItem $_[0] -OK | Should -Be "- [x] $($_[0])" }
$falses | ForEach-Object { New-CheckListItem $_[0] | Should -Be "- [ ] $($_[0])" }
}
# it 'Changed files in PR' {
# $files = Get-AllChangedFilesInPR 9
# $files.filename | Should -Be @('README.template.md', 'bucket/Added.json', 'bucket/FRD.json', 'bucket/PotPlayer.json')
# $files.status | Should -Be @('removed', 'added', 'removed', 'modified')
# }
}