Skip to content

test: address AI findings in unit.test.mjs#82

Merged
kurok merged 1 commit into
masterfrom
fix/ai-findings-unit-test
Jun 9, 2026
Merged

test: address AI findings in unit.test.mjs#82
kurok merged 1 commit into
masterfrom
fix/ai-findings-unit-test

Conversation

@kurok

@kurok kurok commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Fixes the 2 GitHub AI code-quality findings reported on test/unit.test.mjs.

Findings addressed

  1. Hardcoded token in test configuration — the token value used a
    real-looking UUID-style string (XXXXXXXX-eb8e-5f25-fad2-...) that
    could be mistaken for a live secret. Replaced it with a clearly fake
    TEST_TOKEN = 'test-not-a-real-token' constant referenced from
    bootOpts.

  2. Missing assertion after clear() — the "should clear a client and
    allow re-creation"
    test re-booted the client without first verifying
    the cleared instance was actually removed. Added
    expect(() => VaultClient.get('primaryClient')).to.throw(Error, 'Invalid instance name')
    immediately after clear() to confirm the instance is gone before
    re-creation.

Verification

npx mocha "test/unit.test.mjs" — all 6 tests pass.

@kurok kurok requested a review from wRLSS as a code owner June 9, 2026 08:19
- Replace hardcoded token-like string with a clearly fake TEST_TOKEN
  constant so it can't be mistaken for a real secret.
- Assert that get() throws after clear() in the re-creation test to
  verify the instance is actually removed before re-booting.

Signed-off-by: kurok <22548029+kurok@users.noreply.github.com>
@kurok kurok force-pushed the fix/ai-findings-unit-test branch from 2f12b21 to abe2574 Compare June 9, 2026 08:22
@kurok kurok merged commit a5ee33d into master Jun 9, 2026
12 checks passed
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.

1 participant