Skip to content

Add success severity with hooks, selectors and summary support#1262

Open
ealush wants to merge 6 commits intolatestfrom
codex/implement-generalized-severities-for-vest
Open

Add success severity with hooks, selectors and summary support#1262
ealush wants to merge 6 commits intolatestfrom
codex/implement-generalized-severities-for-vest

Conversation

@ealush
Copy link
Copy Markdown
Owner

@ealush ealush commented Mar 15, 2026

Walkthrough - Success Severity Polish & Serialization Fix

I have completed the changes requested in the PR review, including fixing the serialization bug and addressing several polish items.

Changes Made

1. Fixed Serialization Bug

  • File: SuiteSerializer.ts
  • Fix: Removed severity from DisallowedKeys and updated stripMessagesExceptFailedAndWarning to include TestSeverity.Success. This ensures that success messages and the success severity level are preserved when a suite is serialized and resumed.

2. PR Polish Items

  • Error Strings: Capitalized "Success" in ErrorStrings.ts for consistency with "Warn".
  • Type Neutrality: Introduced SeverityMessages as an alias for FailureMessages in suiteSelectors.ts to provide better semantics for success-related selectors.
  • Test Helpers: Added passingSuccessAsync to testDummy.ts for completeness.
  • Documentation/Tests: Updated test descriptions in useSeverity.test.ts to reflect the removal of info severity.

3. Test Refactoring

  • Renamed successAndInfoSelectors.test.ts to successSelectors.test.ts.
  • Removed redundant getMessage integration tests (already covered in getFailure.test.ts).
  • Updated coexistence tests to use Mode.ALL, as Vest's default EAGER mode correctly stops field execution upon the first error.

Verification Results

Automated Tests

  • Ran the full Vest test suite (143 files, 1386 tests).
  • All tests passed, including updated snapshots for SuiteSerializer.test.ts.
 Test Files  143 passed (143)
      Tests  1386 passed (1386)
   Duration  8.77s

Manual Verification

  • Verified that hasSuccesses and getSuccesses work as expected even when errors exist on the same field (when using Mode.ALL).
  • Confirmed that serialized dumps now contain the severity field and success messages.

Next Steps

Summary by CodeRabbit

  • New Features

    • Added a "success" severity and related APIs: success(), useSuccess(), useSeverity(), and new selectors (hasSuccesses, getSuccesses, hasSuccessesByGroup, getSuccessesByGroup). Result objects now include success counts and messages.
  • Tests

    • Added/updated tests and snapshots to cover success/info severities, hooks, selectors, and priority behavior.
  • Documentation

    • New "Success messages" guide and updated API docs to document success-related APIs.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vest Ready Ready Preview, Comment Mar 21, 2026 10:54pm
vest-next Ready Ready Preview, Comment Mar 21, 2026 10:54pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 15, 2026

📝 Walkthrough

Walkthrough

Adds a new "success" severity across Vest: enums and summary fields, hooks (sync and hook-based), suite selectors and serialization support, core test severity APIs, test utilities, updated tests/snapshots, and documentation; no changes to existing error-handling semantics beyond severity classification.

Changes

Cohort / File(s) Summary
Severity enums & types
packages/vest/src/suiteResult/Severity.ts, packages/vest/src/suiteResult/SuiteResultTypes.ts, packages/vest/src/suiteResult/Severity.ts
Added TestSeverity.Success, Severity.SUCCESSES, SeverityCount.SUCCESS_COUNT; added successCount and successes to summary types; refactored countKeyBySeverity.
Core test API
packages/vest/src/core/isolate/IsolateTest/VestTest.ts, packages/vest/src/core/isolate/IsolateTest/__tests__/severity.test.ts, packages/vest/src/core/test/testLevelFlowControl/verifyTestRun.ts
Added VestTest.isSuccess; updated fail()/reset() severity handling; adjusted skip decision to accept test object. New unit tests for severity behavior.
Hooks & public re-exports
packages/vest/src/hooks/useSuccess.ts, packages/vest/src/hooks/success.ts, packages/vest/src/hooks/useSeverity.ts, packages/vest/src/vest.ts
Added useSuccess, success() wrapper, and useSeverity (error/success/warn setters). Re-exported hooks from public API.
Selectors & summary production
packages/vest/src/suiteResult/selectors/suiteSelectors.ts, packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts, packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts, packages/vest/src/suiteResult/selectors/__tests__/successSelectors.test.ts
Introduced successes-aware selectors: hasSuccesses, getSuccesses, group variants; centralized summary severity mapping and aggregation (collect successes into summary). Added tests for selector behavior and severity priority.
Serialization & parser
packages/vest/src/exports/SuiteSerializer.ts, packages/vest/src/exports/parser.ts, packages/vest/src/exports/__tests__/parser.test.ts, packages/vest/src/exports/__tests__/classnames.test.ts
Preserve success severity during serialization and include success in stripped-message logic. Added ParsedVestObject.success() selector and updated related tests; extended classnames mapping to include success key.
Helpers & hooks optional mode
packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts, packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts, packages/vest/src/hooks/optional/mode.ts
Refactored nonMatchingSeverityProfile to use explicit severity mapping and VestTest.isSuccess; changed useShouldSkipBasedOnMode signature to accept TIsolateTest and consider success when skipping.
Test utilities & dummies
packages/vest/src/testUtils/testDummy.ts, packages/vest/src/testUtils/suiteDummy.ts
Added passingSuccess / passingSuccessAsync helpers and suiteDummy.success() to produce success-marked test runs for tests.
Tests & snapshot updates
packages/vest/src/__tests__/integration.stateful-tests.test.ts, packages/vest/src/core/test/__tests__/key.test.ts, packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts, packages/vest/src/suite/__tests__/resetField.test.ts
Updated inline snapshots across multiple tests to include successCount: 0 and successes: [] fields in SummaryBase outputs.
Hook & severity tests
packages/vest/src/hooks/__tests__/severityHooks.test.ts, packages/vest/src/hooks/__tests__/useSeverity.test.ts, packages/vest/src/hooks/__tests__/successSeverityAssertion.test.ts, packages/vest/src/hooks/__tests__/useSuccess.test.ts
Added tests covering useSeverity, useSuccess, success() usage, async behavior, and error cases when hooks are called outside test context.
Docs & website
plans/generalized_severities_summary.md, website/docs/writing_tests/success_tests.md, website/docs/api_reference.md, website/static/llms-full.txt, website/static/llms.txt
New documentation for success messages and hook usage; API reference updated to list success()/useSuccess() and new suite-result selectors; planning doc updated.
Error messages
packages/vest/src/errors/ErrorStrings.ts
Added error strings for misuse of success and useSuccess/useSeverity when called outside a test.
Misc tests
Various __tests__ updated
Added/updated tests exercising priority behavior, selectors, and snapshots to account for success severity additions.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Body
    participant Hook as useSuccess()/success()
    participant VestTest as VestTest API
    participant Producer as Summary Producer
    participant Selector as Suite Selector

    Test->>Hook: call success() or useSuccess().success()
    Hook->>VestTest: VestTest.setSeverity(test, TestSeverity.Success)
    VestTest->>VestTest: update test.data.severity to Success

    Producer->>VestTest: iterate test objects
    VestTest->>Producer: getSummarySeverity(test) -> SUCCESSES (if passing)
    Producer->>Producer: increment successCount, push to successes[]

    Selector->>Producer: hasSuccesses()/getSuccesses()
    Producer->>Selector: return successes data
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

Poem

🐰 I hopped through tests and left a mark,
A tiny stamp — a joyful spark,
Successes now bloom where checks run true,
Hooks and selectors sing, "We see you!"
Tidy summaries, bright and neat — a carrot for each passing feat.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding a success severity with related hooks, selectors, and summary support. It accurately summarizes the core objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/implement-generalized-severities-for-vest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add success and info severities with hooks, selectors and summary support

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add success and info severity levels with dedicated hooks
• Implement severity selectors and parser support for new levels
• Update test aggregation to collect success/info only for passing tests
• Extend suite summary with success/info counts and message arrays
Diagram
flowchart LR
  A["TestSeverity enum"] -->|extends| B["VestTest severity methods"]
  B -->|isSuccess, isInfo| C["Severity hooks"]
  C -->|success, info, useSeverity| D["Public API exports"]
  B -->|setSeverity| E["Suite summary aggregation"]
  E -->|getSummarySeverity| F["SuiteSummary counts and arrays"]
  F -->|successCount, infoCount| G["Suite selectors"]
  G -->|hasSuccesses, getSuccesses, hasInfo, getInfo| H["Parser support"]
Loading

Grey Divider

File Changes

1. packages/vest/src/suiteResult/Severity.ts ✨ Enhancement +16/-3

Extend severity enums with success and info

packages/vest/src/suiteResult/Severity.ts


2. packages/vest/src/suiteResult/SuiteResultTypes.ts ✨ Enhancement +6/-0

Add success/info count and message fields

packages/vest/src/suiteResult/SuiteResultTypes.ts


3. packages/vest/src/core/isolate/IsolateTest/VestTest.ts ✨ Enhancement +13/-1

Add isSuccess and isInfo severity check methods

packages/vest/src/core/isolate/IsolateTest/VestTest.ts


View more (26)
4. packages/vest/src/core/isolate/IsolateTest/__tests__/severity.test.ts 🧪 Tests +23/-0

Test VestTest severity defaults and setters

packages/vest/src/core/isolate/IsolateTest/tests/severity.test.ts


5. packages/vest/src/hooks/success.ts ✨ Enhancement +7/-0

Implement success hook wrapper

packages/vest/src/hooks/success.ts


6. packages/vest/src/hooks/info.ts ✨ Enhancement +7/-0

Implement info hook wrapper

packages/vest/src/hooks/info.ts


7. packages/vest/src/hooks/useSuccess.ts ✨ Enhancement +16/-0

Implement useSuccess hook for severity setting

packages/vest/src/hooks/useSuccess.ts


8. packages/vest/src/hooks/useInfo.ts ✨ Enhancement +16/-0

Implement useInfo hook for severity setting

packages/vest/src/hooks/useInfo.ts


9. packages/vest/src/hooks/useSeverity.ts ✨ Enhancement +24/-0

Implement unified useSeverity hook with warn/success/info

packages/vest/src/hooks/useSeverity.ts


10. packages/vest/src/hooks/__tests__/severityHooks.test.ts 🧪 Tests +27/-0

Test success and info hooks behavior

packages/vest/src/hooks/tests/severityHooks.test.ts


11. packages/vest/src/hooks/__tests__/useSeverity.test.ts 🧪 Tests +36/-0

Test useSeverity hook functionality

packages/vest/src/hooks/tests/useSeverity.test.ts


12. packages/vest/src/suiteResult/selectors/suiteSelectors.ts ✨ Enhancement +152/-0

Add success/info selector methods and interfaces

packages/vest/src/suiteResult/selectors/suiteSelectors.ts


13. packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts 🧪 Tests +34/-0

Test success and info selector functionality

packages/vest/src/suiteResult/selectors/tests/successAndInfoSelectors.test.ts


14. packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts ✨ Enhancement +50/-14

Update aggregation for success/info severity handling

packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts


15. packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts ✨ Enhancement +13/-4

Extend severity profile matching for new severities

packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts


16. packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts 🧪 Tests +14/-1

Test success severity profile matching

packages/vest/src/core/test/helpers/tests/nonMatchingSeverityProfile.test.ts


17. packages/vest/src/exports/parser.ts ✨ Enhancement +4/-0

Add success and info to parser output

packages/vest/src/exports/parser.ts


18. packages/vest/src/exports/__tests__/parser.test.ts 🧪 Tests +40/-0

Test parser success and info methods

packages/vest/src/exports/tests/parser.test.ts


19. packages/vest/src/testUtils/testDummy.ts ✨ Enhancement +27/-1

Add passingSuccess and passingInfo dummy test helpers

packages/vest/src/testUtils/testDummy.ts


20. packages/vest/src/testUtils/suiteDummy.ts ✨ Enhancement +12/-0

Add success and info suite dummy creators

packages/vest/src/testUtils/suiteDummy.ts


21. packages/vest/src/vest.ts ✨ Enhancement +10/-0

Export new severity hooks and functions

packages/vest/src/vest.ts


22. packages/vest/src/errors/ErrorStrings.ts ✨ Enhancement +5/-0

Add error messages for new severity hooks

packages/vest/src/errors/ErrorStrings.ts


23. plans/generalized_severities_summary.md 📝 Documentation +23/-0

Document generalized severities implementation

plans/generalized_severities_summary.md


24. packages/vest/src/__tests__/integration.stateful-tests.test.ts 🧪 Tests +16/-0

Update snapshots with success/info fields

packages/vest/src/tests/integration.stateful-tests.test.ts


25. packages/vest/src/core/test/__tests__/key.test.ts 🧪 Tests +24/-0

Update snapshots with success/info fields

packages/vest/src/core/test/tests/key.test.ts


26. packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts 🧪 Tests +56/-0

Update snapshots with success/info fields

packages/vest/src/core/test/tests/merging_of_previous_test_runs.test.ts


27. packages/vest/src/suite/__tests__/resetField.test.ts 🧪 Tests +8/-0

Update snapshots with success/info fields

packages/vest/src/suite/tests/resetField.test.ts


28. packages/vest/src/exports/__tests__/classnames.test.ts 🧪 Tests +12/-0

Test classnames with success and info fields

packages/vest/src/exports/tests/classnames.test.ts


29. website/static/llms-full.txt 📝 Documentation +31/-1

Update documentation for memo options

website/static/llms-full.txt


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 15, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. Serialized success/info lost🐞 Bug ✓ Correctness
Description
SuiteSerializer.serialize drops severity and strips message for PASSING tests, so a resumed
suite cannot reconstruct success/info summary entries and selectors like
hasSuccesses()/hasInfo() will return false even if the original run had them. This breaks the
new public success/info severities when consumers rely on SuiteSerializer for persistence/resume.
Code

packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts[R210-222]

+function getSummarySeverity(testObject: TIsolateTest): Severity | null {
+  const severityMatches: Record<Severity, boolean> = {
+    [Severity.ERRORS]: VestTest.isFailing(testObject).unwrap(),
+    [Severity.INFO]:
+      VestTest.isPassing(testObject).unwrap() &&
+      VestTest.isInfo(testObject).unwrap(),
+    [Severity.SUCCESSES]:
+      VestTest.isPassing(testObject).unwrap() &&
+      VestTest.isSuccess(testObject).unwrap(),
+    [Severity.WARNINGS]:
+      VestTest.isWarning(testObject).unwrap() &&
+      VestTest.warns(testObject).unwrap(),
+  };
Evidence
Success/info are only recognized for PASSING tests by checking the per-test severity, and messages
are only appended when message is present. SuiteSerializer strips message unless the node is
FAILED/WARNING and also removes the severity field entirely, so after resume there is insufficient
data to ever populate successes/info arrays/counts from the persisted tree.

packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts[194-253]
packages/vest/src/core/isolate/IsolateTest/VestTest.ts[103-117]
packages/vest/src/exports/SuiteSerializer.ts[80-99]
packages/vest/src/exports/SuiteSerializer.ts[122-129]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`SuiteSerializer.serialize()` currently removes `severity` and strips `message` for PASSING tests. The new success/info feature relies on both of these fields to populate `successes/info` in the produced summary, so success/info cannot be reconstructed after `SuiteSerializer.resume()`.
### Issue Context
- `useProduceSuiteSummary.getSummarySeverity()` only classifies success/info for PASSING tests by checking `VestTest.isSuccess()`/`isInfo()` (severity-based).
- `incrementFailures()` only appends messages when `message` is present.
- `SuiteSerializer` currently keeps `message` only for FAILED/WARNING and explicitly removes `severity`.
### Fix Focus Areas
- packages/vest/src/exports/SuiteSerializer.ts[80-99]
- packages/vest/src/exports/SuiteSerializer.ts[122-129]
- packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts[194-253]
### Implementation notes
- In `strip()`, expand `shouldKeepMessage` to also keep messages for `testStatus === PASSING` when `severity` is `success` or `info`.
- Remove `&amp;amp;amp;#x27;severity&amp;amp;amp;#x27;` from `DisallowedKeys` so it survives serialization.
- Add/extend tests (likely under `packages/vest/src/exports/__tests__/SuiteSerializer.test.ts`) to cover success/info round-trip.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the Vest validation framework by introducing success and info severities. This enhancement provides developers with more expressive ways to categorize validation results beyond just errors and warnings, enabling richer feedback and better control over validation flows. The changes are deeply integrated, affecting core test processing, summary generation, and the public API through new hooks and selectors, ensuring a consistent and robust experience for these new severity types.

Highlights

  • New Severities Introduced: Added success and info as new test severities to the validation framework, allowing for more granular reporting of positive test outcomes.
  • New Hooks and Selectors: Introduced new public hooks (success(), info(), useSuccess(), useInfo(), useSeverity()) and suite selectors (hasSuccesses, getSuccesses, hasInfo, getInfo, and their ByGroup variants) to interact with the new severities.
  • Summary and Core Logic Updates: Updated SuiteSummary and SummaryBase to include successCount and infoCount, and modified the aggregation logic to correctly collect messages for passing tests with these new severities. The VestTest.setSeverity method now unifies severity updates.
  • Parser and Utility Enhancements: The parse() function now supports success and info output, and the classnames utility has been updated to reflect the new severities. Dummy test utilities (testDummy, suiteDummy) were also extended.
  • Improved Severity Profile Matching: The nonMatchingSeverityProfile logic was updated to ensure that failed success or info tests are not incorrectly categorized as blocking errors.
  • Comprehensive Testing: New unit tests were added (severity.test.ts, severityHooks.test.ts, useSeverity.test.ts, successAndInfoSelectors.test.ts) and existing snapshots were updated across various integration and unit tests to cover the new severity behaviors and outputs.
Changelog
  • packages/vest/src/tests/snapshots/integration.async-tests.test.ts.snap
    • Updated snapshot to include info, infoCount, successCount, and successes fields in the summary.
  • packages/vest/src/tests/snapshots/integration.base.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/tests/snapshots/integration.stateful-async.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/tests/snapshots/integration.stateful-tests.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/tests/integration.stateful-tests.test.ts
    • Updated test expectations to include info, infoCount, successCount, and successes fields in the summary.
  • packages/vest/src/core/tests/snapshots/runtime.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/core/isolate/IsolateTest/VestTest.ts
    • Added isInfo and isSuccess static methods.
    • Modified fail method to use TestSeverity.Error for determining failure status.
  • packages/vest/src/core/isolate/IsolateTest/tests/severity.test.ts
    • Added new test file to verify VestTest severity handling, including default error severity and setting success/info severities.
  • packages/vest/src/core/test/tests/snapshots/test.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/core/test/tests/key.test.ts
    • Updated test expectations to include info, infoCount, successCount, and successes fields in the summary.
  • packages/vest/src/core/test/helpers/tests/nonMatchingSeverityProfile.test.ts
    • Updated test file to include tests for nonMatchingSeverityProfile with TestSeverity.Success.
  • packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts
    • Modified nonMatchingSeverityProfile to correctly handle success and info severities.
  • packages/vest/src/errors/ErrorStrings.ts
    • Added new error strings for success, info, and useSeverity hooks.
  • packages/vest/src/exports/tests/snapshots/memo.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/exports/tests/classnames.test.ts
    • Updated classnames utility tests to include passingSuccess and passingInfo test cases.
  • packages/vest/src/exports/tests/parser.test.ts
    • Added new test cases for parse().success() and parse().info() methods, including serialized results.
  • packages/vest/src/exports/parser.ts
    • Added info and success selectors to the parse function and ParsedVestObject type.
  • packages/vest/src/hooks/tests/snapshots/include.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/hooks/tests/severityHooks.test.ts
    • Added new test file to verify the behavior of success(), info(), and warn() hooks.
  • packages/vest/src/hooks/tests/useSeverity.test.ts
    • Added new test file to verify the useSeverity hook, including its setters and error handling.
  • packages/vest/src/hooks/focused/tests/snapshots/focused.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/hooks/info.ts
    • Added new info hook that uses useInfo to set test severity.
  • packages/vest/src/hooks/success.ts
    • Added new success hook that uses useSuccess to set test severity.
  • packages/vest/src/hooks/useInfo.ts
    • Added new useInfo hook to set the current test's severity to TestSeverity.Info.
  • packages/vest/src/hooks/useSeverity.ts
    • Added new useSeverity hook providing info(), success(), and warn() setters for the current test.
  • packages/vest/src/hooks/useSuccess.ts
    • Added new useSuccess hook to set the current test's severity to TestSeverity.Success.
  • packages/vest/src/isolates/tests/snapshots/group.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/isolates/tests/snapshots/omitWhen.test.ts.snap
    • Updated snapshot to include info, infoCount, successCount, and successes fields in the summary.
  • packages/vest/src/isolates/tests/snapshots/skipWhen.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/suite/tests/snapshots/create.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/suite/tests/snapshots/focus.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions.
  • packages/vest/src/suite/tests/snapshots/suite.dump.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/suite/tests/resetField.test.ts
    • Updated test expectations to include info, infoCount, successCount, and successes fields in the summary.
  • packages/vest/src/suite/after/tests/snapshots/afterEach.test.ts.snap
    • Updated snapshot to include info, infoCount, successCount, and successes fields in the summary.
  • packages/vest/src/suiteResult/Severity.ts
    • Extended Severity and SeverityCount enums with SUCCESSES and INFO.
    • Updated countKeyBySeverity and TestSeverity enums to include new severities.
  • packages/vest/src/suiteResult/SuiteResultTypes.ts
    • Extended SummaryBase and SuiteSummary classes to include successCount, infoCount, successes, and info fields.
    • Extended CommonSummaryProperties type to include successes and info fields.
  • packages/vest/src/suiteResult/tests/snapshots/useProduceSuiteSummary.test.ts.snap
    • Updated snapshot to include new getInfo, getInfoByGroup, getSuccesses, getSuccessesByGroup, hasInfo, hasInfoByGroup, hasSuccesses, hasSuccessesByGroup functions and info, infoCount, successCount, successes fields.
  • packages/vest/src/suiteResult/selectors/tests/successAndInfoSelectors.test.ts
    • Added new test file to verify hasSuccesses, getSuccesses, hasInfo, and getInfo selectors.
  • packages/vest/src/suiteResult/selectors/suiteSelectors.ts
    • Added new getInfo, getSuccesses, getInfoByGroup, getSuccessesByGroup, hasInfo, hasSuccesses, hasInfoByGroup, and hasSuccessesByGroup selectors.
  • packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts
    • Modified addSummaryStats and updateFailures functions to correctly aggregate and categorize success and info severities.
    • Introduced getSummarySeverity and isErrorFailure helper functions.
    • Updated baseTestStats to initialize info and successes arrays.
  • packages/vest/src/testUtils/suiteDummy.ts
    • Added success and info helper functions to suiteDummy for creating test suites with new severities.
  • packages/vest/src/testUtils/testDummy.ts
    • Added passingSuccess and passingInfo helper functions to testDummy for creating tests with new severities.
  • packages/vest/src/vest.ts
    • Exported new success, info, useSuccess, useInfo, and useSeverity hooks.
  • plans/generalized_severities_summary.md
    • Added a new markdown file detailing the public API changes and execution trace for generalized severities.
  • website/static/llms-full.txt
    • Updated documentation for memo to include options parameter with cacheSize and ttl.
Activity
  • Ran the baseline test suite to ensure a stable starting point.
  • Extended severity domain types to include SUCCESSES and INFO with corresponding count keys.
  • Extended VestTest with isSuccess and isInfo support, and aligned warn with setSeverity.
  • Added and exported new success/info hooks from the main vest module.
  • Updated suite summary aggregation to correctly collect success/info messages only for passing tests.
  • Updated selectors and their interfaces to expose success/info queries at both suite and group levels.
  • Adjusted severity profile matching to ensure failed success/info tests are not treated as blocking errors.
  • Added targeted unit tests for core severity behavior, hook functionality, and selector accuracy.
  • Re-ran all automated tests and performed linting to ensure code quality and stability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces success and info severities, which is a great extension to the library's validation model. The changes are comprehensive, covering new hooks, selectors, and summary logic, and are well-tested. The implementation is consistent with the existing codebase patterns. I've found one minor opportunity for simplification in the summary production logic to improve code clarity.

Comment on lines +234 to +241
function isErrorFailure(testObject: TIsolateTest): boolean {
return (
VestTest.isFailing(testObject).unwrap() &&
!VestTest.warns(testObject).unwrap() &&
!VestTest.isSuccess(testObject).unwrap() &&
!VestTest.isInfo(testObject).unwrap()
);
}
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.

medium

The checks for !warns(), !isSuccess(), and !isInfo() are redundant here. The VestTest.isFailing() check is sufficient on its own.

A test's status is only set to TestStatus.FAILED if its severity was TestSeverity.Error and it failed. If the severity is Error, it cannot simultaneously be Warning, Success, or Info.

Simplifying this function will improve readability and reduce complexity.

function isErrorFailure(testObject: TIsolateTest): boolean {
  return VestTest.isFailing(testObject).unwrap();
}

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 15, 2026

🚀 Benchmark Results

Suite Benchmark Ops/sec (Hz) P99 (ms) Margin of Error Diff (Abs) Diff (%)
Complex Data Validation Enforce Huge String 362.23 6.892 4.60% 0 0.00%
State Management Serialize Large 265.51 4.711 1.65% -22.82 -7.91% ⚠️
Integration & Edge Cases Callback Overhead 3.115 323.6 0.30% 0 0.00%
Complex Feature Mix full run with feature flags 140.64 11.4507 7.89% 0 0.00%
Complex Feature Mix focused/conditional run 236.43 8.0201 3.06% -15.41 -6.12% ⚠️
Conditional isolates skip even indices 624.35 3.5646 7.09% 0 0.00%
Conditional isolates omit multiples of 4 370.33 12.0375 18.54% 0 0.00%
Dynamic each and groups longer list 247.2 12.8408 21.70% 0 0.00%
Reconciler & History Diffing Reconciler (Stable List) 3.185 339.7 2.61% 0 0.00%
Reconciler & History Diffing Reconciler (Full Invalidation) 3.267 309.6 0.65% 0 0.00%
Reconciler & History Diffing Reconciler (Prepend Item) 3.25 310.07 0.50% 0 0.00%
Reconciler & History Diffing Reconciler (Append Item) 3.247 315.19 0.85% 0 0.00%
Reconciler & History Diffing Reconciler (Interleaved) 3.232 316.25 0.67% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Reverse) 3.232 313.68 0.62% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Shuffle) 3.255 321.26 1.21% 0 0.00%
Reconciler & History Diffing Orphan GC Pressure 6.445 157.57 1.00% 0 0.00%
Result Selectors & Reporting hasErrors (Volume) 692.31 2.0732 1.05% 0 0.00%
Result Selectors & Reporting getErrors (Group Lookup) 424.77 2.7724 0.67% 0 0.00%
Result Selectors & Reporting Summary Generation (Large) 2.619 388.24 0.66% 0 0.00%
Async & Concurrency Stress Pending Storm (Memory) 3.242 311.29 0.45% 0 0.00%
Async & Concurrency Stress Resolve Storm (Throughput) 3.266 310.44 0.57% 0 0.00%
Async & Concurrency Stress Reject Storm 3.224 313.86 0.64% 0 0.00%
Async & Concurrency Stress Async Race 157.48 8.433 3.13% -8.81 -5.30% ⚠️
Control Flow & Hooks Internals test.memo (Thrashing) 149.47 8.3681 2.36% 0 0.00%
Control Flow & Hooks Internals test.memo (Stagnation) 590.34 2.982 1.66% -51.42 -8.01% ⚠️
Control Flow & Hooks Internals skipWhen (Active) 6.831 149.32 0.83% 0 0.00%
Control Flow & Hooks Internals only Starvation (Early) 6.008 170.52 1.38% 0 0.00%
Control Flow & Hooks Internals only Starvation (Late) 6.018 168.4 0.57% 0 0.00%
VestBus & Internals Bus Scaling 178.97 7.2082 2.19% 0 0.00%
VestBus & Internals State Refill 122.17 10.2277 2.29% 0 0.00%
Memory & Object Lifecycle Test Object Allocator 6.906 147.54 0.77% 0 0.00%
Memory & Object Lifecycle Garbage Collection Friendly 6.793 148.48 0.47% 0 0.00%
Serialization Serialize (Large) 134.01 9.1339 2.14% 0 0.00%
Serialization Deserialize (Large) 79.485 14.8871 2.12% -4.372 -5.21% ⚠️
Edge Cases & Integration Broad Group 3.263 309.96 0.55% 0 0.00%
Edge Cases & Integration Namespace Collision 3.302 308.27 0.70% 0 0.00%
Edge Cases & Integration Large Field Names 182.23 7.1033 2.24% 0 0.00%
Edge Cases & Integration Large Failure Messages 324.21 5.0407 2.91% -26.4 -7.53% ⚠️
Feature Coverage Matrix enforce matrix (small payload) 404.94 5.4891 6.43% 0 0.00%
Feature Coverage Matrix enforce matrix (larger payload) 613.85 6.8585 10.24% -92.89 -13.14% ⚠️
Feature Coverage Matrix flow control eager mode 348.71 6.6318 7.32% 0 0.00%
Feature Coverage Matrix flow control one mode 283.69 7.3895 7.19% 0 0.00%
Reordering & Reconciliation each (Reorder - Reverse) 98.897 22.7039 8.44% 0 0.00%
Reordering & Reconciliation each (Reorder - Insert Middle) 97.207 14.822 3.98% 0 0.00%
Reordering & Reconciliation each (Reorder - Delete Middle) 102.93 13.4709 3.55% 0 0.00%
Reordering & Reconciliation each (Key Thrashing) 237.29 7.8427 5.56% -15.01 -5.95% ⚠️
State Mutation & Reset suite.remove() (Many Fields) 158.72 7.8715 1.58% 0 0.00%
State Mutation & Reset suite.reset() (Memory Reclamation) 6.864 148.19 0.86% 0 0.00%
Concurrency & Events Bus Stress 3.331 302.19 0.31% 0 0.00%
Nested Fields with Hooks depth 3 with 40 fields per level 10.898 97.2845 5.56% 0 0.00%
Nested Fields with Hooks depth 4 with 60 fields per level 5.329 202.92 19.08% 0 0.00%
Nested Fields with Hooks depth 5 with 80 fields per level 4.749 211.21 3.91% 0 0.00%
Field Volume Stress 10 fields 370.76 8.9539 6.93% 0 0.00%
Field Volume Stress 500 fields 3.909 261.51 0.66% 0 0.00%
Field Volume Stress 1000 fields 1.63 622.04 0.66% 0 0.00%
Deep Nesting Stress depth 10 76.43 47.1938 8.29% -8.183 -9.67% ⚠️
Deep Nesting Stress depth 50 29.872 39.0024 2.23% -2.68 -8.23% ⚠️
Deep Nesting Stress depth 100 18.962 54.381 0.91% 0 0.00%
Complex Combinations & Edge Cases High Frequency test Creation 174.66 7.8591 2.19% 0 0.00%
Core Test Functionality test (High Volume, Same Name) 3.367 300.4 0.47% 0 0.00%
Core Test Functionality test (High Volume, Unique Names) 3.297 307.04 0.54% 0 0.00%
Raw Output
See CI logs for full output
PREVIOUS_RESULTS

🚀 Benchmark Results

Suite Benchmark Ops/sec (Hz) P99 (ms) Margin of Error Diff (Abs) Diff (%)
Complex Data Validation Enforce Huge String 347.48 8.8436 7.27% +35.64 +11.43% 🎉
State Management Serialize Large 265.31 4.7542 1.80% -30.62 -10.35% ⚠️
Integration & Edge Cases Callback Overhead 4.188 242.21 0.47% 0 0.00%
Complex Feature Mix full run with feature flags 128.85 12.0998 8.02% -12.45 -8.81% ⚠️
Complex Feature Mix focused/conditional run 229.57 7.8161 2.68% -19.77 -7.93% ⚠️
Conditional isolates skip even indices 568.59 3.3261 6.35% +139.23 +32.43% 🎉
Conditional isolates omit multiples of 4 462.65 4.3877 11.46% -130.87 -22.05% ⚠️
Dynamic each and groups longer list 190.87 14.4642 24.29% 0 0.00%
Reconciler & History Diffing Reconciler (Stable List) 4.046 282.77 4.04% 0 0.00%
Reconciler & History Diffing Reconciler (Full Invalidation) 4.191 243.77 0.71% 0 0.00%
Reconciler & History Diffing Reconciler (Prepend Item) 4.155 259.77 2.02% 0 0.00%
Reconciler & History Diffing Reconciler (Append Item) 4.208 239.39 0.30% 0 0.00%
Reconciler & History Diffing Reconciler (Interleaved) 4.195 240.79 0.32% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Reverse) 4.196 239.31 0.22% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Shuffle) 4.181 249.61 1.14% 0 0.00%
Reconciler & History Diffing Orphan GC Pressure 8.061 127.4 0.77% 0 0.00%
Result Selectors & Reporting hasErrors (Volume) 848.7 1.4871 0.93% 0 0.00%
Result Selectors & Reporting getErrors (Group Lookup) 485.24 2.4565 0.44% +78.94 +19.43% 🎉
Result Selectors & Reporting Summary Generation (Large) 3.699 272.56 0.43% 0 0.00%
Async & Concurrency Stress Pending Storm (Memory) 4.087 247.73 0.61% 0 0.00%
Async & Concurrency Stress Resolve Storm (Throughput) 4.142 243.71 0.37% 0 0.00%
Async & Concurrency Stress Reject Storm 4.09 248.45 0.54% 0 0.00%
Async & Concurrency Stress Async Race 169.7 7.4397 2.68% 0 0.00%
Control Flow & Hooks Internals test.memo (Thrashing) 161.22 10.7943 2.65% 0 0.00%
Control Flow & Hooks Internals test.memo (Stagnation) 598.14 2.7894 1.44% -45.75 -7.11% ⚠️
Control Flow & Hooks Internals skipWhen (Active) 8.561 119.27 0.78% 0 0.00%
Control Flow & Hooks Internals only Starvation (Early) 7.258 141.28 1.25% 0 0.00%
Control Flow & Hooks Internals only Starvation (Late) 7.402 135.75 0.20% 0 0.00%
VestBus & Internals Bus Scaling 195.62 7.0354 1.97% 0 0.00%
VestBus & Internals State Refill 125.21 10.3846 2.51% 0 0.00%
Memory & Object Lifecycle Test Object Allocator 8.541 121.88 1.09% 0 0.00%
Memory & Object Lifecycle Garbage Collection Friendly 8.612 116.75 0.24% 0 0.00%
Serialization Serialize (Large) 134.24 9.059 2.43% 0 0.00%
Serialization Deserialize (Large) 82.645 13.3401 1.93% -10.685 -11.45% ⚠️
Edge Cases & Integration Broad Group 4.168 242.13 0.39% 0 0.00%
Edge Cases & Integration Namespace Collision 4.23 238.5 0.29% 0 0.00%
Edge Cases & Integration Large Field Names 196.38 7.2528 2.11% 0 0.00%
Edge Cases & Integration Large Failure Messages 343.39 5.4476 2.95% 0 0.00%
Feature Coverage Matrix enforce matrix (small payload) 372.86 7.2074 7.82% 0 0.00%
Feature Coverage Matrix enforce matrix (larger payload) 595.05 8.6849 10.49% -94.18 -13.66% ⚠️
Feature Coverage Matrix flow control eager mode 324.79 6.4319 7.23% 0 0.00%
Feature Coverage Matrix flow control one mode 277.23 7.1534 7.13% -26.38 -8.69% ⚠️
Reordering & Reconciliation each (Reorder - Reverse) 101.94 17.0634 6.92% -10.01 -8.94% ⚠️
Reordering & Reconciliation each (Reorder - Insert Middle) 102.21 13.0518 3.58% 0 0.00%
Reordering & Reconciliation each (Reorder - Delete Middle) 109.33 12.0819 3.57% 0 0.00%
Reordering & Reconciliation each (Key Thrashing) 269.12 6.5186 4.48% 0 0.00%
State Mutation & Reset suite.remove() (Many Fields) 155.69 34.4048 12.53% 0 0.00%
State Mutation & Reset suite.reset() (Memory Reclamation) 9.02 111.77 0.51% 0 0.00%
Concurrency & Events Bus Stress 4.366 237.1 0.97% 0 0.00%
Nested Fields with Hooks depth 3 with 40 fields per level 11.623 96.4379 10.14% 0 0.00%
Nested Fields with Hooks depth 4 with 60 fields per level 6.372 182.21 35.28% 0 0.00%
Nested Fields with Hooks depth 5 with 80 fields per level 6.266 160.45 6.85% 0 0.00%
Field Volume Stress 10 fields 341.99 8.8225 5.34% -19.56 -5.41% ⚠️
Field Volume Stress 500 fields 4.948 207.39 0.86% 0 0.00%
Field Volume Stress 1000 fields 2.176 461.17 0.18% 0 0.00%
Deep Nesting Stress depth 10 74.423 23.7185 6.19% 0 0.00%
Deep Nesting Stress depth 50 31.113 38.6695 1.68% 0 0.00%
Deep Nesting Stress depth 100 20.316 54.0554 1.26% 0 0.00%
Complex Combinations & Edge Cases High Frequency test Creation 178.45 10.2405 3.42% -18.58 -9.43% ⚠️
Core Test Functionality test (High Volume, Same Name) 4.451 227.1 0.47% 0 0.00%
Core Test Functionality test (High Volume, Unique Names) 4.41 227.79 0.22% 0 0.00%
Raw Output
See CI logs for full output

🚀 Benchmark Results

Suite Benchmark Ops/sec (Hz) P99 (ms) Margin of Error Diff (Abs) Diff (%)
Complex Data Validation Enforce Huge String 311.21 8.8919 4.99% -46.13 -12.91% ⚠️
State Management Serialize Large 289.9 4.5494 2.00% -19.72 -6.37% ⚠️
Integration & Edge Cases Callback Overhead 4.276 238.64 0.66% 0 0.00%
Complex Feature Mix full run with feature flags 135.15 13.6714 7.86% 0 0.00%
Complex Feature Mix focused/conditional run 240.95 7.6671 2.87% 0 0.00%
Conditional isolates skip even indices 552.34 4.1812 8.55% 0 0.00%
Conditional isolates omit multiples of 4 471.31 4.6071 9.68% 0 0.00%
Dynamic each and groups longer list 224.91 10.5919 17.27% 0 0.00%
Reconciler & History Diffing Reconciler (Stable List) 4.085 278.95 3.74% 0 0.00%
Reconciler & History Diffing Reconciler (Full Invalidation) 4.169 245.02 0.92% 0 0.00%
Reconciler & History Diffing Reconciler (Prepend Item) 4.141 245.74 0.89% 0 0.00%
Reconciler & History Diffing Reconciler (Append Item) 4.197 242.25 0.61% 0 0.00%
Reconciler & History Diffing Reconciler (Interleaved) 4.157 245.56 0.57% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Reverse) 4.208 242.97 0.73% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Shuffle) 4.174 249.7 1.14% 0 0.00%
Reconciler & History Diffing Orphan GC Pressure 8.007 128.87 0.98% 0 0.00%
Result Selectors & Reporting hasErrors (Volume) 867.35 1.4782 1.14% 0 0.00%
Result Selectors & Reporting getErrors (Group Lookup) 467.61 2.567 0.63% +63.03 +15.58% 🎉
Result Selectors & Reporting Summary Generation (Large) 3.661 275.13 0.33% 0 0.00%
Async & Concurrency Stress Pending Storm (Memory) 4.124 244.14 0.37% 0 0.00%
Async & Concurrency Stress Resolve Storm (Throughput) 4.164 245.91 0.90% 0 0.00%
Async & Concurrency Stress Reject Storm 4.122 243.57 0.21% 0 0.00%
Async & Concurrency Stress Async Race 166.94 8.4166 3.01% 0 0.00%
Control Flow & Hooks Internals test.memo (Thrashing) 161.71 10.5514 2.72% 0 0.00%
Control Flow & Hooks Internals test.memo (Stagnation) 592.88 2.9463 1.71% -38.02 -6.03% ⚠️
Control Flow & Hooks Internals skipWhen (Active) 8.559 122.23 1.19% 0 0.00%
Control Flow & Hooks Internals only Starvation (Early) 7.321 139.53 1.25% 0 0.00%
Control Flow & Hooks Internals only Starvation (Late) 7.377 136.55 0.32% 0 0.00%
VestBus & Internals Bus Scaling 195.73 8.1551 2.34% 0 0.00%
VestBus & Internals State Refill 123.21 11.8633 3.60% 0 0.00%
Memory & Object Lifecycle Test Object Allocator 8.622 116.68 0.45% 0 0.00%
Memory & Object Lifecycle Garbage Collection Friendly 8.664 116.09 0.28% 0 0.00%
Serialization Serialize (Large) 133.43 10.1021 2.89% -22.34 -14.34% ⚠️
Serialization Deserialize (Large) 89.989 14.2004 2.57% -4.808 -5.07% ⚠️
Edge Cases & Integration Broad Group 4.22 241.59 0.69% 0 0.00%
Edge Cases & Integration Namespace Collision 4.255 238.36 0.48% 0 0.00%
Edge Cases & Integration Large Field Names 197.12 6.4903 2.21% 0 0.00%
Edge Cases & Integration Large Failure Messages 333.04 7.1997 3.88% 0 0.00%
Feature Coverage Matrix enforce matrix (small payload) 371.8 6.6185 7.41% -30.23 -7.52% ⚠️
Feature Coverage Matrix enforce matrix (larger payload) 606.3 4.3013 9.64% 0 0.00%
Feature Coverage Matrix flow control eager mode 302.83 7.2517 8.84% 0 0.00%
Feature Coverage Matrix flow control one mode 281.77 6.6312 6.13% -23.21 -7.61% ⚠️
Reordering & Reconciliation each (Reorder - Reverse) 97.668 28.2531 9.69% -10.992 -10.12% ⚠️
Reordering & Reconciliation each (Reorder - Insert Middle) 101.02 12.3634 3.37% 0 0.00%
Reordering & Reconciliation each (Reorder - Delete Middle) 102.25 15.5041 4.97% -8.54 -7.71% ⚠️
Reordering & Reconciliation each (Key Thrashing) 256.36 7.4116 4.94% -16.81 -6.15% ⚠️
State Mutation & Reset suite.remove() (Many Fields) 171.92 6.7378 1.22% 0 0.00%
State Mutation & Reset suite.reset() (Memory Reclamation) 8.809 116.47 1.16% 0 0.00%
Concurrency & Events Bus Stress 4.393 229.23 0.25% 0 0.00%
Nested Fields with Hooks depth 3 with 40 fields per level 11.213 92.1451 5.79% 0 0.00%
Nested Fields with Hooks depth 4 with 60 fields per level 5.991 195.36 37.72% 0 0.00%
Nested Fields with Hooks depth 5 with 80 fields per level 5.985 170.41 25.35% 0 0.00%
Field Volume Stress 10 fields 345.76 9.3947 5.47% 0 0.00%
Field Volume Stress 500 fields 4.789 213.21 0.63% 0 0.00%
Field Volume Stress 1000 fields 2.095 495.52 0.99% 0 0.00%
Deep Nesting Stress depth 10 75.106 29.0183 6.47% 0 0.00%
Deep Nesting Stress depth 50 31.175 42.5713 2.69% -1.653 -5.03% ⚠️
Deep Nesting Stress depth 100 20.434 50.3861 0.74% 0 0.00%
Complex Combinations & Edge Cases High Frequency test Creation 190.91 8.2707 2.83% 0 0.00%
Core Test Functionality test (High Volume, Same Name) 4.38 230.12 0.52% +0.271 +6.58% 🎉
Core Test Functionality test (High Volume, Unique Names) 4.325 234.16 0.56% 0 0.00%
Raw Output
See CI logs for full output

🚀 Benchmark Results

Suite Benchmark Ops/sec (Hz) P99 (ms) Margin of Error Diff (Abs) Diff (%)
Complex Data Validation Enforce Huge String 327.06 14.1859 10.69% +42.28 +14.85% 🎉
State Management Serialize Large 302.45 5.037 2.01% +64.64 +27.18% 🎉
Integration & Edge Cases Callback Overhead 4.209 240.57 0.50% 0 0.00%
Complex Feature Mix full run with feature flags 131.75 19.4839 6.22% 0 0.00%
Complex Feature Mix focused/conditional run 228.99 8.0972 3.03% -14.29 -5.87% ⚠️
Conditional isolates skip even indices 546.42 3.1949 7.08% 0 0.00%
Conditional isolates omit multiples of 4 451.65 4.6026 10.19% 0 0.00%
Dynamic each and groups longer list 191.41 13.1142 23.78% 0 0.00%
Reconciler & History Diffing Reconciler (Stable List) 4.064 280.58 3.91% 0 0.00%
Reconciler & History Diffing Reconciler (Full Invalidation) 4.129 248.83 0.98% 0 0.00%
Reconciler & History Diffing Reconciler (Prepend Item) 4.172 247.54 1.00% 0 0.00%
Reconciler & History Diffing Reconciler (Append Item) 4.167 242.45 0.42% 0 0.00%
Reconciler & History Diffing Reconciler (Interleaved) 4.164 242.43 0.36% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Reverse) 4.156 246.95 0.72% 0 0.00%
Reconciler & History Diffing Isolate Reordering (Shuffle) 4.144 245.3 0.73% 0 0.00%
Reconciler & History Diffing Orphan GC Pressure 8.01 127.48 0.76% 0 0.00%
Result Selectors & Reporting hasErrors (Volume) 873.35 1.5065 0.76% 0 0.00%
Result Selectors & Reporting getErrors (Group Lookup) 399.18 8.6708 9.37% -48.14 -10.76% ⚠️
Result Selectors & Reporting Summary Generation (Large) 3.603 281.27 0.57% 0 0.00%
Async & Concurrency Stress Pending Storm (Memory) 4.118 247.01 0.81% 0 0.00%
Async & Concurrency Stress Resolve Storm (Throughput) 4.129 246.03 0.69% 0 0.00%
Async & Concurrency Stress Reject Storm 4.011 254.09 0.73% 0 0.00%
Async & Concurrency Stress Async Race 164.8 8.214 3.09% 0 0.00%
Control Flow & Hooks Internals test.memo (Thrashing) 153.08 8.1375 2.44% -10.81 -6.60% ⚠️
Control Flow & Hooks Internals test.memo (Stagnation) 579.04 2.9507 1.69% -58.55 -9.18% ⚠️
Control Flow & Hooks Internals skipWhen (Active) 8.641 121.49 1.50% 0 0.00%
Control Flow & Hooks Internals only Starvation (Early) 7.298 144.44 1.54% 0 0.00%
Control Flow & Hooks Internals only Starvation (Late) 7.27 138.53 0.43% 0 0.00%
VestBus & Internals Bus Scaling 192.65 6.6302 2.06% -10.37 -5.11% ⚠️
VestBus & Internals State Refill 123.7 11.6365 2.79% 0 0.00%
Memory & Object Lifecycle Test Object Allocator 8.641 122.15 1.54% 0 0.00%
Memory & Object Lifecycle Garbage Collection Friendly 8.719 115.49 0.23% 0 0.00%
Serialization Serialize (Large) 145.65 9.6085 2.89% +10.69 +7.92% 🎉
Serialization Deserialize (Large) 91.433 13.9478 2.49% 0 0.00%
Edge Cases & Integration Broad Group 4.182 244.9 0.98% 0 0.00%
Edge Cases & Integration Namespace Collision 4.219 243.22 1.33% 0 0.00%
Edge Cases & Integration Large Field Names 190.42 7.2598 2.40% 0 0.00%
Edge Cases & Integration Large Failure Messages 321.16 5.7669 3.42% -27.49 -7.88% ⚠️
Feature Coverage Matrix enforce matrix (small payload) 353.53 6.7969 7.69% -30.46 -7.93% ⚠️
Feature Coverage Matrix enforce matrix (larger payload) 598.1 4.8355 10.10% 0 0.00%
Feature Coverage Matrix flow control eager mode 297.7 7.781 8.68% 0 0.00%
Feature Coverage Matrix flow control one mode 273.29 8.3932 7.61% 0 0.00%
Reordering & Reconciliation each (Reorder - Reverse) 101.64 19.4838 6.73% -7.71 -7.05% ⚠️
Reordering & Reconciliation each (Reorder - Insert Middle) 96.49 13.3765 3.84% -5.37 -5.27% ⚠️
Reordering & Reconciliation each (Reorder - Delete Middle) 104.41 14.0787 4.18% 0 0.00%
Reordering & Reconciliation each (Key Thrashing) 255.92 7.093 4.95% -19.85 -7.20% ⚠️
State Mutation & Reset suite.remove() (Many Fields) 163.93 9.1761 2.22% 0 0.00%
State Mutation & Reset suite.reset() (Memory Reclamation) 8.694 116.8 0.60% 0 0.00%
Concurrency & Events Bus Stress 4.303 233.33 0.25% 0 0.00%
Nested Fields with Hooks depth 3 with 40 fields per level 11.425 93.7414 8.19% 0 0.00%
Nested Fields with Hooks depth 4 with 60 fields per level 6.089 181.32 22.59% 0 0.00%
Nested Fields with Hooks depth 5 with 80 fields per level 6.034 166.05 2.54% 0 0.00%
Field Volume Stress 10 fields 319.58 10.2085 5.56% -38.02 -10.63% ⚠️
Field Volume Stress 500 fields 4.753 216.69 0.93% 0 0.00%
Field Volume Stress 1000 fields 2.094 482.96 0.49% 0 0.00%
Deep Nesting Stress depth 10 73.232 31.1459 6.89% 0 0.00%
Deep Nesting Stress depth 50 30.882 41.6186 2.46% 0 0.00%
Deep Nesting Stress depth 100 19.79 52.5215 0.90% 0 0.00%
Complex Combinations & Edge Cases High Frequency test Creation 182.33 8.9624 2.77% 0 0.00%
Core Test Functionality test (High Volume, Same Name) 4.231 239.11 0.48% 0 0.00%
Core Test Functionality test (High Volume, Unique Names) 4.177 247.75 0.91% 0 0.00%
Raw Output
See CI logs for full output

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (5)
packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts (1)

54-65: Add an explicit INFO severity assertion in this matrix.

This block now validates SUCCESS, but not INFO in the same non-matching matrix. A small companion case here would make regressions easier to catch.

✅ Suggested test addition
   describe('When test is success', () => {
     it('should return true for errors and false for successes', () => {
       VestTest.setSeverity(testObject, TestSeverity.Success);

       expect(
         nonMatchingSeverityProfile(Severity.ERRORS, testObject).unwrap(),
       ).toBe(true);
       expect(
         nonMatchingSeverityProfile(Severity.SUCCESSES, testObject).unwrap(),
       ).toBe(false);
     });
   });
+
+  describe('When test is info', () => {
+    it('should return true for errors and false for info', () => {
+      VestTest.setSeverity(testObject, TestSeverity.Info);
+
+      expect(
+        nonMatchingSeverityProfile(Severity.ERRORS, testObject).unwrap(),
+      ).toBe(true);
+      expect(
+        nonMatchingSeverityProfile(Severity.INFO, testObject).unwrap(),
+      ).toBe(false);
+    });
+  });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts`
around lines 54 - 65, Add an explicit assertion for INFO in the "When test is
success" matrix: after calling VestTest.setSeverity(testObject,
TestSeverity.Success) and the existing nonMatchingSeverityProfile checks, also
call nonMatchingSeverityProfile(Severity.INFO, testObject).unwrap() and assert
the expected boolean (likely false for a success), so the test covers INFO
alongside ERRORS and SUCCESSES; target the nonMatchingSeverityProfile function
and the VestTest.setSeverity / TestSeverity.Success setup when adding this
assertion.
packages/vest/src/hooks/__tests__/severityHooks.test.ts (1)

6-26: Assert severity outcomes explicitly, not only isValid().

On Line 25, isValid() alone won’t catch regressions in success()/info() routing or the “last severity wins” behavior.

Suggested test tightening
 import { describe, expect, it } from 'vitest';
 
 import { create, enforce, info, success, test, warn } from '../../vest';
+import { parse } from '../../exports/parser';
@@
     const res = suite.run();
+    const parsed = parse(res);
 
     expect(res.isValid()).toBe(true);
+    expect(parsed.success('field1')).toBe(true);
+    expect(parsed.info('field2')).toBe(true);
+    expect(parsed.success('field3')).toBe(true);
+    expect(parsed.warning('field3')).toBe(false);
   });
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/hooks/__tests__/severityHooks.test.ts` around lines 6 - 26,
The test currently only checks res.isValid() which won't verify that the
severity hooks (success(), info(), warn()) and "last severity wins" behavior are
applied to individual tests; update the test to assert each test's severity
explicitly by inspecting the suite run result (e.g., the individual test results
returned by suite.run() or result.getTests()/res.tests) and asserting that the
'field1' result has severity 'success' (or equivalent success marker), 'field2'
has 'info', and 'field3' reflects the last call ('success' after warn). Locate
and update assertions around suite.run() and res to validate the per-test
severity values rather than only isValid().
packages/vest/src/exports/__tests__/parser.test.ts (1)

469-507: Add field-level assertions for parse().success and parse().info.

These tests currently verify suite-level behavior only; the new methods also accept fieldName and should be covered.

Suggested additions
   describe('parse().success', () => {
@@
     it('Should return false when the suite has no successes', () => {
       expect(parse(suiteDummy.failing()).success()).toBe(false);
     });
+    it('Should return true when provided field has success', () => {
+      expect(parse(suiteDummy.success('username')).success('username')).toBe(true);
+    });
@@
   describe('parse().info', () => {
@@
     it('Should return false when the suite has no info', () => {
       expect(parse(suiteDummy.failing()).info()).toBe(false);
     });
+    it('Should return true when provided field has info', () => {
+      expect(parse(suiteDummy.info('username')).info('username')).toBe(true);
+    });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/exports/__tests__/parser.test.ts` around lines 469 - 507,
Add tests that exercise the field-level overloads of parse().success(fieldName)
and parse().info(fieldName): for each of success and info, add assertions that
passing a matching field name returns true and a non-matching or missing field
returns false, and duplicate these checks for both raw and serialized inputs
(use parse(suiteDummy.success()).success('fieldName'),
parse(ser(suiteDummy.success())).success('fieldName'),
parse(suiteDummy.failing()).success('fieldName') etc., and the analogous
parse(...).info('fieldName') cases). Ensure you cover true/false expectations
for both suiteDummy.success()/info() and suiteDummy.failing(), and include tests
for serialized results via ser(...).
packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts (1)

16-32: Pin the silent-drop contract for failed positive severities.

This covers the failed success() path, but it doesn't guard against that case being reclassified as a warning, and it doesn't exercise the separate failed-info() branch.

🧪 Suggested coverage
       test('failCase', 'should not be appended if enforcement fails', () => {
         success();
         enforce(1).equals(2);
       });
+      test('failInfo', 'should not be appended if enforcement fails', () => {
+        info();
+        enforce(1).equals(2);
+      });
     });

     const res = suite.run();
@@
     expect(res.getSuccesses('pass')).toEqual(['good password']);
     expect(res.getInfo('user')).toEqual(['auto formatted']);

     expect(res.hasSuccesses('failCase')).toBe(false);
+    expect(res.hasWarnings('failCase')).toBe(false);
+    expect(res.hasInfo('failInfo')).toBe(false);
+    expect(res.hasWarnings('failInfo')).toBe(false);
     expect(res.isValid()).toBe(true);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts`
around lines 16 - 32, Add tests to pin the "silent-drop" behavior for failed
positive severities by covering two missing cases: (1) verify that a failed
success() call cannot be reclassified as a warning by exercising
enforce(...).equals(...) on a success-labeled test (use the same suite, call
success(); enforce(...).equals(...); run suite.run() and assert
hasSuccesses('...') is false and hasInfo/hasWarnings remains as expected), and
(2) add a separate failing info() branch test to confirm failed info() is
silently dropped (call info('msg'); enforce(...).equals(...); run and assert
getInfo(...) does not include 'msg' and isValid() state). Target
functions/selectors: success(), info(), enforce(), suite.run(), hasSuccesses(),
hasInfo(), getSuccesses(), getInfo(), isValid() so the assertions match the
intended silent-drop contract.
plans/generalized_severities_summary.md (1)

7-11: Consider varying repeated bullet/step openers for readability.

Several consecutive items start with the same verb (“Added” / “Updated”). Rewording a few improves scanability without changing meaning.

Also applies to: 20-22

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plans/generalized_severities_summary.md` around lines 7 - 11, The list
repeats the same opener ("Added"/"Updated") and should vary phrasing for
readability; edit the bullets that mention the SuiteResult selectors
(`hasSuccesses`, `getSuccesses`, `hasInfo`, `getInfo`, `hasSuccessesByGroup`,
`getSuccessesByGroup`, `hasInfoByGroup`, `getInfoByGroup`) to use different
verbs or structures (e.g., "Introduced", "Added support for", "Added
selectors:", "Also added") so consecutive items don't begin identically while
retaining original meaning.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vest/src/core/isolate/IsolateTest/VestTest.ts`:
- Around line 207-213: The bug is that VestTest.reset() doesn't restore test
severity, so VestTest.fail() can read a stale severity (TestSeverity.Warning)
and downgrade fails; update VestTest.reset() to explicitly set the test's
severity back to TestSeverity.Error via VestTest.getData(test).severity =
TestSeverity.Error (or using the existing setter if one exists) for the same
test objects that VestTest.warn() modifies; ensure this reset happens before
reruns so VestTest.fail() and VestTest.setStatus(...) behave correctly.

In `@packages/vest/src/hooks/__tests__/useSeverity.test.ts`:
- Around line 11-23: The test claims to exercise warn, success and info but
never calls info(); update the test inside the create(...) callback where you
obtain severity via useSeverity() (the block that currently calls
severity.warn() and severity.success()) to also call severity.info() so all
three setters are invoked; keep the rest of the assertion using
VestTest.cast(t).unwrap() and VestTest.isSuccess(...) unchanged.

In `@website/static/llms-full.txt`:
- Around line 5562-5565: The TTL option description contains a typo ("test
blocked will be re-run"); update the table cell for the `ttl` option (adjacent
to `cacheSize`) to replace that phrase with the correct wording such as
"memoized block will be re-run" or "test block will be re-run" so the
description reads: "Time-to-Live in milliseconds. If the cached result is older
than the `ttl`, the cache will be invalidated and the memoized block will be
re-run." Ensure you edit the `ttl` description text only.

---

Nitpick comments:
In
`@packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts`:
- Around line 54-65: Add an explicit assertion for INFO in the "When test is
success" matrix: after calling VestTest.setSeverity(testObject,
TestSeverity.Success) and the existing nonMatchingSeverityProfile checks, also
call nonMatchingSeverityProfile(Severity.INFO, testObject).unwrap() and assert
the expected boolean (likely false for a success), so the test covers INFO
alongside ERRORS and SUCCESSES; target the nonMatchingSeverityProfile function
and the VestTest.setSeverity / TestSeverity.Success setup when adding this
assertion.

In `@packages/vest/src/exports/__tests__/parser.test.ts`:
- Around line 469-507: Add tests that exercise the field-level overloads of
parse().success(fieldName) and parse().info(fieldName): for each of success and
info, add assertions that passing a matching field name returns true and a
non-matching or missing field returns false, and duplicate these checks for both
raw and serialized inputs (use parse(suiteDummy.success()).success('fieldName'),
parse(ser(suiteDummy.success())).success('fieldName'),
parse(suiteDummy.failing()).success('fieldName') etc., and the analogous
parse(...).info('fieldName') cases). Ensure you cover true/false expectations
for both suiteDummy.success()/info() and suiteDummy.failing(), and include tests
for serialized results via ser(...).

In `@packages/vest/src/hooks/__tests__/severityHooks.test.ts`:
- Around line 6-26: The test currently only checks res.isValid() which won't
verify that the severity hooks (success(), info(), warn()) and "last severity
wins" behavior are applied to individual tests; update the test to assert each
test's severity explicitly by inspecting the suite run result (e.g., the
individual test results returned by suite.run() or result.getTests()/res.tests)
and asserting that the 'field1' result has severity 'success' (or equivalent
success marker), 'field2' has 'info', and 'field3' reflects the last call
('success' after warn). Locate and update assertions around suite.run() and res
to validate the per-test severity values rather than only isValid().

In
`@packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts`:
- Around line 16-32: Add tests to pin the "silent-drop" behavior for failed
positive severities by covering two missing cases: (1) verify that a failed
success() call cannot be reclassified as a warning by exercising
enforce(...).equals(...) on a success-labeled test (use the same suite, call
success(); enforce(...).equals(...); run suite.run() and assert
hasSuccesses('...') is false and hasInfo/hasWarnings remains as expected), and
(2) add a separate failing info() branch test to confirm failed info() is
silently dropped (call info('msg'); enforce(...).equals(...); run and assert
getInfo(...) does not include 'msg' and isValid() state). Target
functions/selectors: success(), info(), enforce(), suite.run(), hasSuccesses(),
hasInfo(), getSuccesses(), getInfo(), isValid() so the assertions match the
intended silent-drop contract.

In `@plans/generalized_severities_summary.md`:
- Around line 7-11: The list repeats the same opener ("Added"/"Updated") and
should vary phrasing for readability; edit the bullets that mention the
SuiteResult selectors (`hasSuccesses`, `getSuccesses`, `hasInfo`, `getInfo`,
`hasSuccessesByGroup`, `getSuccessesByGroup`, `hasInfoByGroup`,
`getInfoByGroup`) to use different verbs or structures (e.g., "Introduced",
"Added support for", "Added selectors:", "Also added") so consecutive items
don't begin identically while retaining original meaning.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b534b07-509f-40c7-a17f-1f82c4b8ed5c

📥 Commits

Reviewing files that changed from the base of the PR and between d8c22eb and 15dbca2.

⛔ Files ignored due to path filters (17)
  • packages/vest/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/__tests__/__snapshots__/integration.base.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/core/__tests__/__snapshots__/runtime.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/exports/__tests__/__snapshots__/memo.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/hooks/__tests__/__snapshots__/include.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/hooks/focused/__tests__/__snapshots__/focused.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/isolates/__tests__/__snapshots__/group.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/__tests__/__snapshots__/create.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/__tests__/__snapshots__/focus.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/__tests__/__snapshots__/suite.dump.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/after/__tests__/__snapshots__/afterEach.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suiteResult/__tests__/__snapshots__/useProduceSuiteSummary.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (29)
  • packages/vest/src/__tests__/integration.stateful-tests.test.ts
  • packages/vest/src/core/isolate/IsolateTest/VestTest.ts
  • packages/vest/src/core/isolate/IsolateTest/__tests__/severity.test.ts
  • packages/vest/src/core/test/__tests__/key.test.ts
  • packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts
  • packages/vest/src/core/test/helpers/__tests__/nonMatchingSeverityProfile.test.ts
  • packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts
  • packages/vest/src/errors/ErrorStrings.ts
  • packages/vest/src/exports/__tests__/classnames.test.ts
  • packages/vest/src/exports/__tests__/parser.test.ts
  • packages/vest/src/exports/parser.ts
  • packages/vest/src/hooks/__tests__/severityHooks.test.ts
  • packages/vest/src/hooks/__tests__/useSeverity.test.ts
  • packages/vest/src/hooks/info.ts
  • packages/vest/src/hooks/success.ts
  • packages/vest/src/hooks/useInfo.ts
  • packages/vest/src/hooks/useSeverity.ts
  • packages/vest/src/hooks/useSuccess.ts
  • packages/vest/src/suite/__tests__/resetField.test.ts
  • packages/vest/src/suiteResult/Severity.ts
  • packages/vest/src/suiteResult/SuiteResultTypes.ts
  • packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts
  • packages/vest/src/suiteResult/selectors/suiteSelectors.ts
  • packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts
  • packages/vest/src/testUtils/suiteDummy.ts
  • packages/vest/src/testUtils/testDummy.ts
  • packages/vest/src/vest.ts
  • plans/generalized_severities_summary.md
  • website/static/llms-full.txt

Comment on lines +11 to +23
it('should expose warn, success and info severity setters', () => {
let t;

create(() => {
t = test(faker.lorem.word(), faker.lorem.sentence(), () => {
const severity = useSeverity();
severity.warn();
severity.success();
});
}).run();

expect(VestTest.isSuccess(VestTest.cast(t).unwrap()).unwrap()).toBe(true);
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Test intent mentions info, but info() is never exercised.

Line 11 claims all three setters are covered, but Lines 17–19 only invoke warn and success.

Minimal fix to match the test contract
   it('should expose warn, success and info severity setters', () => {
@@
       t = test(faker.lorem.word(), faker.lorem.sentence(), () => {
         const severity = useSeverity();
         severity.warn();
         severity.success();
+        severity.info();
       });
     }).run();
 
-    expect(VestTest.isSuccess(VestTest.cast(t).unwrap()).unwrap()).toBe(true);
+    expect(VestTest.isInfo(VestTest.cast(t).unwrap()).unwrap()).toBe(true);
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it('should expose warn, success and info severity setters', () => {
let t;
create(() => {
t = test(faker.lorem.word(), faker.lorem.sentence(), () => {
const severity = useSeverity();
severity.warn();
severity.success();
});
}).run();
expect(VestTest.isSuccess(VestTest.cast(t).unwrap()).unwrap()).toBe(true);
});
it('should expose warn, success and info severity setters', () => {
let t;
create(() => {
t = test(faker.lorem.word(), faker.lorem.sentence(), () => {
const severity = useSeverity();
severity.warn();
severity.success();
severity.info();
});
}).run();
expect(VestTest.isInfo(VestTest.cast(t).unwrap()).unwrap()).toBe(true);
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/hooks/__tests__/useSeverity.test.ts` around lines 11 - 23,
The test claims to exercise warn, success and info but never calls info();
update the test inside the create(...) callback where you obtain severity via
useSeverity() (the block that currently calls severity.warn() and
severity.success()) to also call severity.info() so all three setters are
invoked; keep the rest of the assertion using VestTest.cast(t).unwrap() and
VestTest.isSuccess(...) unchanged.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/vest/src/hooks/__tests__/useSeverity.test.ts (1)

11-23: ⚠️ Potential issue | 🟡 Minor

Test description is inconsistent with the PR changes and actual test behavior.

The test description on Line 11 claims to test "error, warn, success and info severity setters", but:

  1. Per the PR objectives, info was removed from the severity model
  2. The test body only calls severity.warn() and severity.success() (Lines 17-18), not error() or info()

The description should be updated to accurately reflect what's being tested.

📝 Suggested fix
-  it('should expose error, warn, success and info severity setters', () => {
+  it('should expose warn and success severity setters', () => {

Or, if the intent is to also verify error():

-  it('should expose error, warn, success and info severity setters', () => {
+  it('should expose error, warn, and success severity setters', () => {
     let t;
 
     create(() => {
       t = test(faker.lorem.word(), faker.lorem.sentence(), () => {
         const severity = useSeverity();
+        severity.error();
         severity.warn();
         severity.success();
       });
     }).run();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/hooks/__tests__/useSeverity.test.ts` around lines 11 - 23,
Update the test description string to match the actual assertions: change the
it(...) title that currently says 'should expose error, warn, success and info
severity setters' to something like 'should expose warn and success severity
setters' since the test only calls useSeverity().warn() and
useSeverity().success() (functions referenced as useSeverity, severity.warn,
severity.success) and the 'info' severity was removed; alternatively, if you
want to also verify error(), modify the test body to call severity.error() and
assert accordingly, but do not leave the description and behavior mismatched.
🧹 Nitpick comments (3)
packages/vest/src/testUtils/testDummy.ts (1)

117-127: Consider adding an async variant for consistency.

The test dummy exports async variants for other test types (passingWarningAsync, failingAsync, etc.) but lacks a passingSuccessAsync variant. This may be intentional if async success tests aren't needed, but it creates an asymmetry in the API.

♻️ Optional: Add async success helper
+const createPassingSuccessAsync = (
+  name = faker.lorem.word(),
+  { message = faker.lorem.words(), time = 0 } = {},
+) =>
+  vestTest(
+    name as TFieldName,
+    message,
+    vi.fn(async () => {
+      success();
+      await wait(time);
+    }),
+  );
+
 const testDummy = () => ({
   failing: createFailing,
   failingAsync: createFailingAsync,
   failingWarning: createFailingWarning,
   failingWarningAsync: createFailingWarningAsync,
   passing: createPassing,
   passingAsync: createPassingAsync,
   passingSuccess: createPassingSuccess,
+  passingSuccessAsync: createPassingSuccessAsync,
   passingWarning: createPassingWarning,
   passingWarningAsync: createPassingWarningAsync,
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/testUtils/testDummy.ts` around lines 117 - 127, testDummy
currently exposes a sync passingSuccess helper but no async counterpart,
creating an inconsistent API; add a passingSuccessAsync entry to the returned
object that maps to the async helper (e.g., createPassingSuccessAsync) and
ensure that the async helper function (createPassingSuccessAsync) exists and
behaves like passingSuccess but returns a resolved Promise so it matches other
*Async helpers; update the testDummy return object to include
passingSuccessAsync alongside passingSuccess.
packages/vest/src/suiteResult/selectors/suiteSelectors.ts (1)

396-398: Avoid exposing failure-centric types through the success API.

getSuccesses* returning FailureMessages makes the public TypeScript surface read as though successes are failures. A neutral alias here (for example SeverityMessages) would keep the API self-descriptive as more non-error severities are added.

Also applies to: 417-425

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/suiteResult/selectors/suiteSelectors.ts` around lines 396 -
398, The public signatures for getSuccesses currently expose the failure-centric
type FailureMessages; update the API to use a neutral alias (e.g.,
SeverityMessages) instead of FailureMessages so success-related APIs do not
reference "failure" types. Replace FailureMessages with the new alias in all
getSuccesses overloads (the group declared as getSuccesses(): FailureMessages;
getSuccesses(fieldName: InputFieldName<F>): string[]; getSuccesses(fieldName?:
InputFieldName<F>): string[] | FailureMessages;) and the analogous overloads at
the later block (lines referenced in the review), and ensure the underlying type
alias (SeverityMessages = FailureMessages) is defined and exported where
appropriate so existing internals keep working while the public surface reads
neutrally.
packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts (1)

132-179: These getMessage precedence cases are duplicated.

This block overlaps with packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts at Lines 278-317. Keeping the priority matrix in one place would reduce drift and keep this file focused on success-selector behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts`
around lines 132 - 179, The four duplicated integration tests for getMessage
(covering precedence of error > warn > success and undefined when no success)
should be removed from this file and kept in a single canonical location to
avoid drift; locate the block starting with "describe('getMessage integration')"
that contains tests invoking create(), test(...), success(), warn(), and
suite.run(), then either delete those it() cases here (or replace them with a
minimal reference to the canonical test) so the canonical versions in
getFailure.test.ts remain as the single source of truth; ensure any shared setup
uses the same create/test/success/warn helpers if you extract to a shared
helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vest/src/errors/ErrorStrings.ts`:
- Around line 7-12: The error messages have inconsistent capitalization: update
the SUCCESS_MUST_BE_CALLED_FROM_TEST constant in ErrorStrings.ts so it matches
the style of WARN_MUST_BE_CALLED_FROM_TEST (capitalize the word "Success"
instead of "success"); locate the SUCCESS_MUST_BE_CALLED_FROM_TEST symbol and
change its string to "Success must be called from within the body of a test
function" (leave USE_SUCCESS_MUST_BE_CALLED_FROM_TEST and other messages
unchanged).

---

Duplicate comments:
In `@packages/vest/src/hooks/__tests__/useSeverity.test.ts`:
- Around line 11-23: Update the test description string to match the actual
assertions: change the it(...) title that currently says 'should expose error,
warn, success and info severity setters' to something like 'should expose warn
and success severity setters' since the test only calls useSeverity().warn() and
useSeverity().success() (functions referenced as useSeverity, severity.warn,
severity.success) and the 'info' severity was removed; alternatively, if you
want to also verify error(), modify the test body to call severity.error() and
assert accordingly, but do not leave the description and behavior mismatched.

---

Nitpick comments:
In
`@packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts`:
- Around line 132-179: The four duplicated integration tests for getMessage
(covering precedence of error > warn > success and undefined when no success)
should be removed from this file and kept in a single canonical location to
avoid drift; locate the block starting with "describe('getMessage integration')"
that contains tests invoking create(), test(...), success(), warn(), and
suite.run(), then either delete those it() cases here (or replace them with a
minimal reference to the canonical test) so the canonical versions in
getFailure.test.ts remain as the single source of truth; ensure any shared setup
uses the same create/test/success/warn helpers if you extract to a shared
helper.

In `@packages/vest/src/suiteResult/selectors/suiteSelectors.ts`:
- Around line 396-398: The public signatures for getSuccesses currently expose
the failure-centric type FailureMessages; update the API to use a neutral alias
(e.g., SeverityMessages) instead of FailureMessages so success-related APIs do
not reference "failure" types. Replace FailureMessages with the new alias in all
getSuccesses overloads (the group declared as getSuccesses(): FailureMessages;
getSuccesses(fieldName: InputFieldName<F>): string[]; getSuccesses(fieldName?:
InputFieldName<F>): string[] | FailureMessages;) and the analogous overloads at
the later block (lines referenced in the review), and ensure the underlying type
alias (SeverityMessages = FailureMessages) is defined and exported where
appropriate so existing internals keep working while the public surface reads
neutrally.

In `@packages/vest/src/testUtils/testDummy.ts`:
- Around line 117-127: testDummy currently exposes a sync passingSuccess helper
but no async counterpart, creating an inconsistent API; add a
passingSuccessAsync entry to the returned object that maps to the async helper
(e.g., createPassingSuccessAsync) and ensure that the async helper function
(createPassingSuccessAsync) exists and behaves like passingSuccess but returns a
resolved Promise so it matches other *Async helpers; update the testDummy return
object to include passingSuccessAsync alongside passingSuccess.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4684e66e-a4f4-4066-956c-474e383f56ec

📥 Commits

Reviewing files that changed from the base of the PR and between 15dbca2 and 6d2fd2b.

⛔ Files ignored due to path filters (17)
  • packages/vest/src/__tests__/__snapshots__/integration.async-tests.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/__tests__/__snapshots__/integration.base.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/__tests__/__snapshots__/integration.stateful-async.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/__tests__/__snapshots__/integration.stateful-tests.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/core/__tests__/__snapshots__/runtime.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/exports/__tests__/__snapshots__/memo.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/hooks/__tests__/__snapshots__/include.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/hooks/focused/__tests__/__snapshots__/focused.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/isolates/__tests__/__snapshots__/group.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/isolates/__tests__/__snapshots__/omitWhen.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/isolates/__tests__/__snapshots__/skipWhen.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/__tests__/__snapshots__/create.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/__tests__/__snapshots__/focus.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/__tests__/__snapshots__/suite.dump.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suite/after/__tests__/__snapshots__/afterEach.test.ts.snap is excluded by !**/*.snap
  • packages/vest/src/suiteResult/__tests__/__snapshots__/useProduceSuiteSummary.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (23)
  • packages/vest/src/__tests__/integration.stateful-tests.test.ts
  • packages/vest/src/core/isolate/IsolateTest/VestTest.ts
  • packages/vest/src/core/isolate/IsolateTest/__tests__/severity.test.ts
  • packages/vest/src/core/test/__tests__/key.test.ts
  • packages/vest/src/core/test/__tests__/merging_of_previous_test_runs.test.ts
  • packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts
  • packages/vest/src/errors/ErrorStrings.ts
  • packages/vest/src/exports/__tests__/classnames.test.ts
  • packages/vest/src/exports/__tests__/parser.test.ts
  • packages/vest/src/exports/parser.ts
  • packages/vest/src/hooks/__tests__/severityHooks.test.ts
  • packages/vest/src/hooks/__tests__/useSeverity.test.ts
  • packages/vest/src/hooks/useSeverity.ts
  • packages/vest/src/suite/__tests__/resetField.test.ts
  • packages/vest/src/suiteResult/Severity.ts
  • packages/vest/src/suiteResult/SuiteResultTypes.ts
  • packages/vest/src/suiteResult/selectors/__tests__/getFailure.test.ts
  • packages/vest/src/suiteResult/selectors/__tests__/successAndInfoSelectors.test.ts
  • packages/vest/src/suiteResult/selectors/suiteSelectors.ts
  • packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts
  • packages/vest/src/testUtils/suiteDummy.ts
  • packages/vest/src/testUtils/testDummy.ts
  • packages/vest/src/vest.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/vest/src/suite/tests/resetField.test.ts
  • packages/vest/src/core/isolate/IsolateTest/VestTest.ts
  • packages/vest/src/testUtils/suiteDummy.ts
  • packages/vest/src/vest.ts
  • packages/vest/src/exports/tests/classnames.test.ts
  • packages/vest/src/core/test/helpers/nonMatchingSeverityProfile.ts
  • packages/vest/src/hooks/tests/severityHooks.test.ts
  • packages/vest/src/tests/integration.stateful-tests.test.ts
  • packages/vest/src/exports/tests/parser.test.ts
  • packages/vest/src/core/isolate/IsolateTest/tests/severity.test.ts
  • packages/vest/src/exports/parser.ts

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/vest/src/testUtils/testDummy.ts (1)

65-75: Inconsistent signature with other async helpers.

Other async helpers in this file (createPassingAsync, createFailingAsync, createPassingWarningAsync) accept { message, time = 0 } as the second parameter and use await wait(time) to simulate async delays. This helper takes message directly and lacks the time parameter.

♻️ Proposed fix to match async helper pattern
 const createPassingSuccessAsync = (
   name = faker.lorem.word(),
-  message = faker.lorem.words(),
+  { message = faker.lorem.words(), time = 0 } = {},
 ) =>
   vestTest(
     name as TFieldName,
     message,
     vi.fn(async () => {
       success();
+      await wait(time);
     }),
   );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/testUtils/testDummy.ts` around lines 65 - 75,
createPassingSuccessAsync currently takes (name, message) and doesn't match
other async helpers' signature; change its second parameter to an options object
({ message, time = 0 }) and inside the vi.fn async callback call await
wait(time) before invoking success() so it mirrors
createPassingAsync/createFailingAsync/createPassingWarningAsync; update
references to vestTest, TFieldName, vi.fn, success, and wait accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vest/src/hooks/optional/mode.ts`:
- Around line 52-55: The early return in useShouldSkipBasedOnMode that
unconditionally returns false for VestTest.isSuccess(testObject) must be removed
or deferred so mode semantics are enforced first; update
useShouldSkipBasedOnMode to evaluate the current mode (ONE and EAGER) and prior
failure state before short-circuiting success tests — i.e., perform mode and
failure checks (handling ONE/EAGER) first, and only allow a success test to run
(VestTest.isSuccess) if the mode/failure logic permits it; adjust the
conditional order/logic in useShouldSkipBasedOnMode to reference
VestTest.isSuccess, the ONE and EAGER mode checks, and the TIsolateTest failure
state so success tests will be skipped when ONE/EAGER semantics require it.

In `@website/docs/api_reference.md`:
- Around line 214-225: The docs section that lists top-level exports currently
mixes removed export memo(...) with the new success()/useSuccess() entries;
remove the memo(...) entry (or move it to a different, specific section if it
still exists elsewhere) so the top-level API docs match the actual export list
in packages/vest/src/vest.ts; update the API reference around the
success()/useSuccess() headings to delete any mention of memo(...) and run a
quick search for other occurrences of memo(...) in the API docs to ensure no
top-level references remain.
- Around line 288-297: The docs list the selector as
hasWarningByGroup(groupName) but the actual API is hasWarningsByGroup(...);
update the API reference entry to use the correct function name
hasWarningsByGroup and ensure the description matches the selector behavior
(parallel to hasErrorsByGroup/hasSuccessesByGroup); reference the real selector
name hasWarningsByGroup (as implemented alongside other selectors in
suiteSelectors.ts) so users copying the docs get the exact API.

---

Nitpick comments:
In `@packages/vest/src/testUtils/testDummy.ts`:
- Around line 65-75: createPassingSuccessAsync currently takes (name, message)
and doesn't match other async helpers' signature; change its second parameter to
an options object ({ message, time = 0 }) and inside the vi.fn async callback
call await wait(time) before invoking success() so it mirrors
createPassingAsync/createFailingAsync/createPassingWarningAsync; update
references to vestTest, TFieldName, vi.fn, success, and wait accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 474d1860-30be-4227-bd74-a7ea14f40485

📥 Commits

Reviewing files that changed from the base of the PR and between 6d2fd2b and 643266a.

⛔ Files ignored due to path filters (1)
  • packages/vest/src/exports/__tests__/__snapshots__/SuiteSerializer.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (10)
  • packages/vest/src/core/test/testLevelFlowControl/verifyTestRun.ts
  • packages/vest/src/errors/ErrorStrings.ts
  • packages/vest/src/exports/SuiteSerializer.ts
  • packages/vest/src/hooks/__tests__/useSeverity.test.ts
  • packages/vest/src/hooks/optional/mode.ts
  • packages/vest/src/suiteResult/selectors/__tests__/successSelectors.test.ts
  • packages/vest/src/suiteResult/selectors/suiteSelectors.ts
  • packages/vest/src/testUtils/testDummy.ts
  • website/docs/api_reference.md
  • website/docs/writing_tests/success_tests.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vest/src/hooks/tests/useSeverity.test.ts

@ealush ealush changed the title Add success and info severities with hooks, selectors and summary support Add success severity with hooks, selectors and summary support Mar 21, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/vest/src/hooks/__tests__/successSeverityAssertion.test.ts (2)

51-65: Same note: consider adding error assertion.

Similar to the sync throw test, adding expect(res.hasErrors('field1')).toBe(true) would confirm the test properly transitioned to an error state.

💡 Optional: Add error assertion
     res = suite.get();
     expect(res.hasSuccesses('field1')).toBe(false);
+    expect(res.hasErrors('field1')).toBe(true);
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/hooks/__tests__/successSeverityAssertion.test.ts` around
lines 51 - 65, Add an assertion to the async rejection test to confirm the test
transitioned to an error state: after awaiting suite.run() and before the final
expect(res.hasSuccesses('field1')).toBe(false), assert that
res.hasErrors('field1') is true. Locate the test case (it 'Should NOT apply the
message when a test rejects (async)') and add
expect(res.hasErrors('field1')).toBe(true) alongside the existing use of
suite.run(), vest.test(...), useSeverity(), and severity.success().

38-49: Consider adding error state assertion for completeness.

The test verifies that success is not recorded, but doesn't confirm the test was recorded as an error. Adding expect(res.hasErrors('field1')).toBe(true) would strengthen coverage.

💡 Optional: Add error assertion
     const res = suite.run();
     expect(res.hasSuccesses('field1')).toBe(false);
+    expect(res.hasErrors('field1')).toBe(true);
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/hooks/__tests__/successSeverityAssertion.test.ts` around
lines 38 - 49, Add an assertion that the thrown error was recorded: in the test
that creates suite via vest.create and runs it (calling vest.test with
useSeverity and severity.success then throwing), after the existing
expect(res.hasSuccesses('field1')).toBe(false) add
expect(res.hasErrors('field1')).toBe(true) so the test verifies both that a
success wasn't applied and that the test is recorded as an error (use the
existing res.hasErrors method).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vest/src/core/isolate/IsolateTest/VestTest.ts`:
- Around line 267-270: The reset method currently calls
VestTest.setSeverity(test, TestSeverity.Error) before VestTest.setStatus(test,
TestAction.RESET), which lets the guard in setSeverity (that returns early when
isTested() is true) prevent clearing severity for completed tests; fix by
reversing the calls so VestTest.setStatus(test, TestAction.RESET) runs first,
then VestTest.setSeverity(...), or alternatively bypass the guard by writing
directly to test data via VestTest.setData(test, { severity: TestSeverity.Error
}) after setting status; update the VestTest.reset implementation to use one of
these approaches (referencing VestTest.reset, VestTest.setSeverity,
VestTest.setStatus, and VestTest.setData).

In `@packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts`:
- Around line 210-228: getSummarySeverity incorrectly requires the declared
severity gate (VestTest.warns) for warnings instead of using runtime status
first, causing WARNING-status tests with Success severity to be dropped; update
getSummarySeverity to decide by runtime status: if
VestTest.isWarning(testObject).unwrap() return Severity.WARNINGS, else if
VestTest.isPassing(testObject).unwrap() &&
VestTest.isSuccess(testObject).unwrap() return Severity.SUCCESSES, else if
VestTest.isFailing(testObject).unwrap() return Severity.ERRORS (or null if none
match). Modify the logic in getSummarySeverity to check VestTest.isWarning
before using VestTest.warns so passing-success warnings are classified as
WARNINGS.

---

Nitpick comments:
In `@packages/vest/src/hooks/__tests__/successSeverityAssertion.test.ts`:
- Around line 51-65: Add an assertion to the async rejection test to confirm the
test transitioned to an error state: after awaiting suite.run() and before the
final expect(res.hasSuccesses('field1')).toBe(false), assert that
res.hasErrors('field1') is true. Locate the test case (it 'Should NOT apply the
message when a test rejects (async)') and add
expect(res.hasErrors('field1')).toBe(true) alongside the existing use of
suite.run(), vest.test(...), useSeverity(), and severity.success().
- Around line 38-49: Add an assertion that the thrown error was recorded: in the
test that creates suite via vest.create and runs it (calling vest.test with
useSeverity and severity.success then throwing), after the existing
expect(res.hasSuccesses('field1')).toBe(false) add
expect(res.hasErrors('field1')).toBe(true) so the test verifies both that a
success wasn't applied and that the test is recorded as an error (use the
existing res.hasErrors method).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 539848c7-d62c-491b-8ce7-c6b105182437

📥 Commits

Reviewing files that changed from the base of the PR and between 643266a and 63d8469.

📒 Files selected for processing (9)
  • packages/vest/src/core/isolate/IsolateTest/VestTest.ts
  • packages/vest/src/hooks/__tests__/successSeverityAssertion.test.ts
  • packages/vest/src/hooks/__tests__/useSeverity.test.ts
  • packages/vest/src/hooks/optional/mode.ts
  • packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts
  • packages/vest/src/testUtils/testDummy.ts
  • website/docs/api_reference.md
  • website/static/llms-full.txt
  • website/static/llms.txt
✅ Files skipped from review due to trivial changes (2)
  • website/static/llms.txt
  • packages/vest/src/hooks/tests/useSeverity.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/vest/src/testUtils/testDummy.ts
  • packages/vest/src/hooks/optional/mode.ts
  • website/docs/api_reference.md

Comment on lines 267 to 270
static reset(test: TIsolateTest): void {
VestTest.setSeverity(test, TestSeverity.Error);
VestTest.setStatus(test, TestAction.RESET);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Order issue: setSeverity guard may prevent reset for completed tests.

setSeverity (lines 225-227) returns early if isTested() is true (FAILED, WARNING, or PASSING status). Since setSeverity is called before setStatus(test, TestAction.RESET), the guard will fire for completed tests, leaving the stale severity unchanged.

Consider reversing the order or bypassing the guard via setData:

🐛 Proposed fix using setData directly
 static reset(test: TIsolateTest): void {
-  VestTest.setSeverity(test, TestSeverity.Error);
   VestTest.setStatus(test, TestAction.RESET);
+  VestTest.setData(test, current => ({
+    ...current,
+    severity: TestSeverity.Error,
+  }));
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
static reset(test: TIsolateTest): void {
VestTest.setSeverity(test, TestSeverity.Error);
VestTest.setStatus(test, TestAction.RESET);
}
static reset(test: TIsolateTest): void {
VestTest.setStatus(test, TestAction.RESET);
VestTest.setData(test, current => ({
...current,
severity: TestSeverity.Error,
}));
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/core/isolate/IsolateTest/VestTest.ts` around lines 267 -
270, The reset method currently calls VestTest.setSeverity(test,
TestSeverity.Error) before VestTest.setStatus(test, TestAction.RESET), which
lets the guard in setSeverity (that returns early when isTested() is true)
prevent clearing severity for completed tests; fix by reversing the calls so
VestTest.setStatus(test, TestAction.RESET) runs first, then
VestTest.setSeverity(...), or alternatively bypass the guard by writing directly
to test data via VestTest.setData(test, { severity: TestSeverity.Error }) after
setting status; update the VestTest.reset implementation to use one of these
approaches (referencing VestTest.reset, VestTest.setSeverity,
VestTest.setStatus, and VestTest.setData).

Comment on lines +210 to +228
function getSummarySeverity(testObject: TIsolateTest): Severity | null {
const severityMatches: Record<Severity, boolean> = {
[Severity.ERRORS]: VestTest.isFailing(testObject).unwrap(),
[Severity.SUCCESSES]:
VestTest.isPassing(testObject).unwrap() &&
VestTest.isSuccess(testObject).unwrap(),
[Severity.WARNINGS]:
VestTest.isWarning(testObject).unwrap() &&
VestTest.warns(testObject).unwrap(),
};

const severityOrder = [
Severity.WARNINGS,
Severity.SUCCESSES,
Severity.ERRORS,
];

return severityOrder.find(severity => severityMatches[severity]) ?? null;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Warning classification now depends on the wrong dimension.

packages/vest/src/core/isolate/IsolateTest/VestTest.ts:103-141 separates runtime status (isWarning) from declared severity (warns / isSuccess). With the extra VestTest.warns(testObject) gate here, a test that ends in TestStatus.WARNING under TestSeverity.Success now returns null, so both addSummaryStats and updateFailures skip it entirely. Warnings should be classified by runtime status first, then passing successes can be special-cased.

💡 Suggested fix
 function getSummarySeverity(testObject: TIsolateTest): Severity | null {
-  const severityMatches: Record<Severity, boolean> = {
-    [Severity.ERRORS]: VestTest.isFailing(testObject).unwrap(),
-    [Severity.SUCCESSES]:
-      VestTest.isPassing(testObject).unwrap() &&
-      VestTest.isSuccess(testObject).unwrap(),
-    [Severity.WARNINGS]:
-      VestTest.isWarning(testObject).unwrap() &&
-      VestTest.warns(testObject).unwrap(),
-  };
-
-  const severityOrder = [
-    Severity.WARNINGS,
-    Severity.SUCCESSES,
-    Severity.ERRORS,
-  ];
-
-  return severityOrder.find(severity => severityMatches[severity]) ?? null;
+  if (VestTest.isWarning(testObject).unwrap()) {
+    return Severity.WARNINGS;
+  }
+
+  if (
+    VestTest.isPassing(testObject).unwrap() &&
+    VestTest.isSuccess(testObject).unwrap()
+  ) {
+    return Severity.SUCCESSES;
+  }
+
+  if (VestTest.isFailing(testObject).unwrap()) {
+    return Severity.ERRORS;
+  }
+
+  return null;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vest/src/suiteResult/selectors/useProduceSuiteSummary.ts` around
lines 210 - 228, getSummarySeverity incorrectly requires the declared severity
gate (VestTest.warns) for warnings instead of using runtime status first,
causing WARNING-status tests with Success severity to be dropped; update
getSummarySeverity to decide by runtime status: if
VestTest.isWarning(testObject).unwrap() return Severity.WARNINGS, else if
VestTest.isPassing(testObject).unwrap() &&
VestTest.isSuccess(testObject).unwrap() return Severity.SUCCESSES, else if
VestTest.isFailing(testObject).unwrap() return Severity.ERRORS (or null if none
match). Modify the logic in getSummarySeverity to check VestTest.isWarning
before using VestTest.warns so passing-success warnings are classified as
WARNINGS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant