Skip to content

test: replace module handler snapshots with explicit assertions#1499

Open
cubicj wants to merge 1 commit into
mainfrom
cubicj-fix-vitest-snapshot-churn
Open

test: replace module handler snapshots with explicit assertions#1499
cubicj wants to merge 1 commit into
mainfrom
cubicj-fix-vitest-snapshot-churn

Conversation

@cubicj

@cubicj cubicj commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

PR Checklist

  • Required Checks
    • Have you added type definitions?
    • Have you tested your changes?
    • Have you checked that it won't break any existing features?
  • If your PR uses models1, check the following:
    • Have you checked if it works normally in all models?
    • Have you checked if it works normally in all web, local, and node-hosted versions? If it doesn't, have you blocked it in those versions?
  • If your PR is highly AI generated2, check the following:
    • Have you understood what the code does?
    • Have you cleaned up any unnecessary or redundant code?
    • Is it not a huge change?
      • We currently do not accept highly AI generated PRs that are large changes.

Summary

Replaces the module MCP handler snapshot tests with explicit assertions.

The module handler tests were the only tests using Vitest snapshots. On Windows with Git autocrlf, running pnpm test could rewrite the snapshot file and leave it marked as modified even when there was no content diff.

Related Issues

None.

Changes

src/ts/process/mcp/risuaccess/tests/modules.test.ts

  • Replaced toMatchSnapshot() checks with explicit toEqual(makeToolResponse(...)) assertions
  • Kept the same expected MCP tool response payloads for module listing, lorebook listing, lorebook retrieval, and regex script listing

src/ts/process/mcp/risuaccess/tests/__snapshots__/modules.test.ts.snap

  • Removed the obsolete Vitest snapshot file

Impact

  • pnpm test no longer rewrites the module handler snapshot file.
  • The tested MCP response behavior is unchanged.
  • Runtime code is unchanged.
  • No request handling, model behavior, storage format, database schema, or platform-specific logic is changed.

Additional Notes

Validated with:

  • pnpm test
  • git diff --check

Footnotes

  1. Modifies the behavior of prompting, requesting, or handling responses from AI models.

  2. Over 80% of the code is AI generated.

@cubicj cubicj marked this pull request as ready for review June 23, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant