GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared): PascalCase test doubles like MockTransport.ts count as mocks by only21mil · Pull Request #41561 · pingdotgg/t3code

Conversation

@only21mil

@only21mil only21mil commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Problem

With "Hide test files" on, PascalCase test doubles stay visible: MockTransport.ts, FakeClock.ts, StubClient.ts, Mocks.ts and Foo.Mock.ts all count as code. Their lowercase twins (mockTransport.ts, fakeClock.ts, mocks.ts, Foo.mock.ts) are hidden as mocks. The same names also count as code in a pull request's code/tests/mocks breakdown. PascalCase is the usual file naming in TypeScript class files, Java, C#, Swift and Kotlin.

MOCK_NAME in packages/shared/src/changedFileKind.ts is fully case-sensitive, so a capital first letter or a capital .Mock. segment never matches.

Change

The regex is split the same way TEST_NAME and CLASS_TEST_NAME already are in that file:

  • MOCK_NAME keeps the suffix forms (.snap, .mock.ts, .fixtures.json, ...) and is now case-insensitive.
  • MOCK_PREFIX keeps the name-prefix form and accepts a capital or lowercase first letter. The boundary after the prefix stays case-sensitive, so MockTransport.ts is a mock and Mockup.ts, mockery.ts and Stubborn.ts stay code. Adding i to the whole old regex would have made those mocks too.

Scope

One file in packages/shared, plus rows in its existing test table. It needs no issue because it is a small fix for an obvious bug: two spellings of the same file name are sorted differently. Web, desktop and mobile all use this function for the hide-tests filter, and the server uses it for the PR breakdown, so all of them pick up the fix with no other change.

Two behaviors follow from the existing rule order and match what the lowercase spellings already do on main. A name that is both a mock and a test, such as MockTransport.test.ts or FakeClockTest.java, now counts as mocks instead of tests; it is still hidden by "Hide test files". A Markdown file like Fixtures.md counts as mocks, like fixtures.md already does.

Verification

An AI agent (T3 Code Nightly) ran each check below.

  • changedFileKind.test.ts: the five PascalCase rows fail on 9fae2cc2288 with expected 'code' to be 'mocks', and all 31 rows pass on this branch. The four negative rows (Mockup.ts, mockup.ts, mockery.ts, Stubborn.ts) pass on both, and fail if i is added to the whole old regex. vp run check:changed passes.

  • Node, calling the shipped classifyChangedFile, isTestChangedFile, summarizeChangedFiles and the server's toChangeBreakdown on the same 11 paths (10 lines each): main gives code 100 / mocks 10, this branch gives code 50 / mocks 60. Every negative stays code.

  • Real app, web client in Linux Chromium.

    Setup: vp run dev --no-seed, fresh isolated dev data on each commit, no accounts. One project: a git repo with uncommitted src/app.ts, src/FakeClock.ts, src/fakeTimer.ts, src/MockTransport.ts and src/Mockup.ts.

    Steps: open a thread in the project → Changes → Diff panel → press "Hide test files".

    9fae2cc2288 (before) 3f434dd53b5 (after)
    With "Hide test files" on, src/FakeClock.ts and src/MockTransport.ts stay in the list; only src/fakeTimer.ts is hidden. With "Hide test files" on, src/FakeClock.ts, src/MockTransport.ts and src/fakeTimer.ts are hidden; src/app.ts and src/Mockup.ts stay.
    With "Hide test files" on, src/FakeClock.ts and src/MockTransport.ts stay in the list; only src/fakeTimer.ts is hidden. With "Hide test files" on, src/FakeClock.ts, src/MockTransport.ts and src/fakeTimer.ts are hidden; src/app.ts and src/Mockup.ts stay.

    Not shown: the pull request Code tab and the mobile file filter. They call the same isTestChangedFile, so they change the same way.

Generated with Gemini 4 Neon in T3 Code Nightly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@only21mil
fix(shared): PascalCase test doubles like MockTransport.ts count as m…
3f434dd
…ocks
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changed-file classifier now recognizes additional mock-support filename prefixes. Tests cover recognized prefixes and similar names that remain classified as code.

Changes: Mock file classification

Layer / File(s) Summary
Mock-support prefix matching
packages/shared/src/changedFileKind.ts, packages/shared/src/changedFileKind.test.ts
The classifier recognizes mock, fixture, stub, and fake filename prefixes with the specified casing and delimiters. Tests cover matching names and similar names classified as code.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested labels: bugfix

Suggested reviewers: aminevg

Merge Risk: Minimal · up to 9f6b7

This change makes PascalCase mock files such as MockTransport.ts count as mocks, matching their lowercase equivalents, while similar names like Mockup.ts stay classified as code. The change is small, has targeted tests, and carries no identified merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: PascalCase test doubles such as MockTransport.ts are now classified as mocks. The raw summary, PR objectives, and description all describe the MOCK_NAME and MOCK_PREFI…
Description check Passed The description follows the template well. It has Problem, Change, Scope, and Verification sections, and the Problem and Change sections explain the regex fix and its boundary rules. Scope justifies t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: PascalCase test doubles such as MockTransport.ts are now classified as mocks. The raw summary, PR objectives, and description all describe the MOCK_NAME and MOCK_PREFIX change in packages/shared/src/changedFileKind.ts that this title covers. It uses a conventional commit format and is specific.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope, and Verification sections, and the Problem and Change sections explain the regex fix and its boundary rules. Scope justifies the absence of a linked issue for a small obvious bug, and Verification gives focused test results, Node checks, and a manual check with observed before and after results. It also notes what was not shown, namely the PR Code tab and the mobile filter. The template's agent-attribution line is present at the end. The template asks for a conventional commit title, and the title meets that. Minor gaps: the Problem section does not give a clear reproduction step beyond the filter toggle, and the description does not note the Linux-only browser environment in detail. These do not affect the assessment.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: fa2ee19
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b123c842-9317-4deb-b802-0f432eae8b02
Commits

Reviewing files that changed from the base of the PR and between 3f434dd and 9f6b76a.

Files selected for processing: 1

  • packages/shared/src/changedFileKind.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
juliusmarminge and others added 2 commits November 23, 2026 17:43
@juliusmarminge @claude
Merge remote-tracking branch 'origin/main' into fix/shared-pascalcase…
803c615
…-mock-file-kind

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge @claude
test(shared): keep only mock-classification rows that fail on main or…
9f6b76a
… guard the boundary

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 23, 2026

Copy link
Copy Markdown
Member

Evidence

Created a repository with README.md committed and six intent-to-add files: app.ts, FakeClock.ts, fakeTimer.ts, MockTransport.ts, Mockup.ts, and Foo.Mock.ts. Opened a Replay thread and its Diff panel, then enabled Hide test files without selecting a file. Both runs used fresh databases, light theme, and a 1440×1000 web viewport.

Before After
fa2ee196b5 9f6b76a7ec
Before: PascalCase test doubles remain visible After: only app.ts and Mockup.ts remain visible
Only fakeTimer.ts is hidden. FakeClock.ts, fakeTimer.ts, MockTransport.ts, and Foo.Mock.ts are hidden.
Before recording After recording

Scenario and seed script. The scenario fails on base and passes on head.

Not shown:

  • PR mocks change-breakdown counts were not exercised: the scenario uses local uncommitted changes and does not create a synthetic pull request.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 23, 2026
@juliusmarminge
juliusmarminge merged commit 0ea0db3 into pingdotgg:main Nov 23, 2026
55 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 2026
@patroza patroza mentioned this pull request Nov 24, 2026
Merge upstream main through 2fe7febc8d73 patroza/t3code#671
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@only21mil @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.