← Back to Pull requests

test(loans): migrate specs to Vitest #476

Closed
unknown closed this pull request without merging on Sep 03, 2026 12:32 UTC
View on GitHub
unknown unknown commented on Sep 01, 2026 22:44 UTC
Author

What and why

Part of #406.

Migrates the remaining 12 loan-area Jasmine/Karma specs to Vitest, removes them from the Karma ratchet baseline, and updates the matching ESLint-suppression paths. The client migration remains in #475.

Verification

  • TZ=UTC npm run test:unit -- --include='src/app/features/loans/*/.test.ts' — 13 files / 59 tests passed, including the already-migrated loan-view spec

  • npm run check:test-runner — 13 Karma specs remain

  • npm run lint

  • npm run lint:prune

  • Prettier check for the changed files

  • npm run i18n:check

  • npm run check:icons

  • npm run build
  • Screenshots

    Not applicable — test-only change.

    Checklist

  • I did not hand-edit generated files under src/app/api/.

  • New component or service code uses the adapter boundary in src/app/core/adapters/ instead of direct browser globals or imperative third-party APIs. Not applicable — test-only change.

  • User-facing strings use translation keys. Not applicable — test-only change.

  • I added or updated tests appropriate to this change.

  • UI workflow changes include suitable e2e coverage, including real-backend testing where relevant. Not applicable — test-only change.

  • Commits are signed — see [Commit Signing](CONTRIBUTING.md#commit-signing) in CONTRIBUTING.md.
  • Diff: 163 lines (+122 / -41) across 2 files Reviewer: zhangxinyao88 Review duration: 2267m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.58) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.58 · 163 lines diff across 2 files
    0.58
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.305
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.058
    Real PR Conversation Timeline
    1 comments
    "Review active on #476"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 58.1% (MEDIUM) · Higher = larger blast radius
    58.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23.0% · Safe to merge
    23.0%