Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
output: results.sarif

- name: Run Pester tests
shell: pwsh
run: |
Invoke-Pester -Path ./tests

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
Expand Down
9 changes: 9 additions & 0 deletions tests/api-auth-script.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Describe "api-auth-script" {
It "creates the expected Authorization header" {
Mock Invoke-RestMethod {}
. "$PSScriptRoot/../API/api-auth-script.ps1"
$expected = 'Basic MTIzIDk3IDEwMCAxMDkgMTA1IDExMCAxMjUgNTggMTIzIDExMiA5NyAxMTUgMTE1IDExOSAxMTEgMTE0IDEwMCAxMjU='
$basicAuthHeader | Should -Be $expected
}
}

Loading