Skip to content

Test to see that main currently fails#92

Closed
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
mainfrom
test
Closed

Test to see that main currently fails#92
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
mainfrom
test

Conversation

@MariusStorhaug

Copy link
Copy Markdown
Member

…ation

Description

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copilot AI review requested due to automatic review settings June 8, 2025 11:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds comprehensive test cases for Get-Context and Get-ContextInfo to verify handling of various ID inputs.

  • Introduce tests for Get-Context -ID with arrays, single IDs, nonexistent, mixed valid/invalid, whitespace, and null values
  • Add multiple-ID scenarios for Get-ContextInfo -ID in VaultA
Comments suppressed due to low confidence (2)

tests/Context.Tests.ps1:342

  • Test description is missing the function name and ID parameter context. Rename to "Get-ContextInfo -ID array - Should return only specified contexts in VaultA" for consistency.
It 'Should return only specified contexts for multiple IDs in VaultA' {

tests/Context.Tests.ps1:342

  • Consider adding tests for Get-ContextInfo covering single ID retrieval, non-existent ID, mixed valid/invalid IDs, and whitespace inputs to mirror the coverage in Get-Context tests.
It 'Should return only specified contexts for multiple IDs in VaultA' {

Comment thread tests/Context.Tests.ps1
Comment on lines +210 to +212
It 'Get-Context -ID with whitespace or null - Should not have output leakage (returns nothing)' {
$results = Get-Context -ID ' ' -Vault 'VaultA'
$results | Should -BeNullOrEmpty

Copilot AI Jun 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This test covers both whitespace and $null IDs in one block, which may hide failures; consider splitting into separate tests for whitespace-only and null inputs for clearer failure isolation.

Suggested change
It 'Get-Context -ID with whitespace or null - Should not have output leakage (returns nothing)' {
$results = Get-Context -ID ' ' -Vault 'VaultA'
$results | Should -BeNullOrEmpty
It 'Get-Context -ID with whitespace - Should not have output leakage (returns nothing)' {
$results = Get-Context -ID ' ' -Vault 'VaultA'
$results | Should -BeNullOrEmpty
}
It 'Get-Context -ID with null - Should not have output leakage (returns nothing)' {

Copilot uses AI. Check for mistakes.
Comment thread tests/Context.Tests.ps1
It 'Get-Context -ID single (nonexistent) - Should not have output leakage (returns nothing)' {
$id = 'NonExistentContext'
$results = Get-Context -ID $id -Vault 'VaultA'
$results | Should -BeNullOrEmpty

Copilot AI Jun 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] When validating that a collection is empty, consider using Should -BeEmpty for clarity and specificity rather than Should -BeNullOrEmpty.

Suggested change
$results | Should -BeNullOrEmpty
$results | Should -BeEmpty

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants