Skip to content

test: prune tests that couldn't tell a break from a refactor - #461

Merged
vite-hub[bot] merged 3 commits into
mainfrom
test/prune-r6
Nov 18, 2026
Merged

vite-hub[bot] merged 3 commits into
mainfrom
test/prune-r6

Conversation

@onmax

@onmax onmax commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Ten tests in this repo couldn't tell a real break from a harmless change. Most went red when nothing broke, and one stayed green when something did. Every test file is now read in full.

The bracket test in packages/annotate/test/tour.test.ts spied on marks.draw and checked its fifth argument. Renaming that internal function, with no change to any frame, turned it red. It now renders each shot's last frame and finds the rows the bracket's spine crosses. A side="top" bracket must sit above a bottom one.

The picker test in packages/ui/test/editor-upload.test.ts checked that the file input was still attached one microtask after chooseFiles() opened it. Removing the input on a setTimeout(…, 0) right after input.click() broke the WebKit rule the source comment states, and the test stayed green. It now waits 20 ms before the check.

Four tests matched the name of the function an HTML renderer inlines as a script (start, relativize, describeTime). Renaming it turned them red, though the page runs the same code. They now check the script's shape, that it calls itself, and that it holds describeTime's source, so the outline test also goes red when the rail's script is written without its call, which the old copy missed.

The lint crash test pinned V8's text for each rule's first null read, such as (reading 'src'). Reading alt before src in comark/missing-alt turned it red. It now checks each crash names its rule and carries the thrown error's message. It came with the fix in #43, and it still goes red when a crash escapes lint() again.

The Svelte tests for comark-links and comark-mark counted the files in src/svelte/, internal helpers included. Moving the heading's # link into its own component turned one red. They now check that every component any of them imports is there.

packages/lint/test/mermaid.test.ts also checked that two Doctor pages contain comark-ui/html. Rewording the example to register the Vue preset, which takes the same mermaid option, turned it red, so those lines are gone.

Test Kind Proof Action
annotate/test/tour.test.ts › "preserves bracket orientation: %s" (2 cases) change detector Renamed draw to drawMark in marks.ts and its two callers: old copy red, new copy green. Dropped mark.edge from the call in tour/draw.ts: new copy red. rewritten as "draws a bracket across the edge that faces its note, as the page does"
ui/test/editor-upload.test.ts › "uploads what the picker returns at the cursor", the isConnected check before change can't fail Added setTimeout(() => input.remove(), 0) after input.click() in upload.ts: old copy green, new copy red. rewritten
outline/test/toc.test.ts › "adds an "On this page" outline…", the railScript check change detector Renamed start to mountRail in script.ts, exported as start: old red, new green. Inlined the function without its call: old green, new red. rewritten
ui/test/ui.test.ts › "zooms a Mermaid diagram…", the mermaidScript check change detector Renamed start to mountMermaidBar: old red, new green. Inlined without the call: both red. rewritten
annotate/test/annotate.test.ts › "carries the slider script once per render" and "gives every screenshot a Copy button…", the script count change detector Renamed start to mountAnnotations: old red, new green. Dropped the once-per-render guard: both red. rewritten
properties/test/properties.test.ts › "follows each box with the script…", the relativize checks change detector Declared relativize and describeTime under other names and exported them by their public names, then rebuilt comark-time: old red, new green. Inlined relativize without describeTime's source: both red. rewritten
lint/test/lint.test.ts › "turns a rule that crashes into one diagnostic…" change detector comark/missing-alt reads alt before src: old red, new green, the missing-alt tests green. A crashing rule throws out of lint() again: both red. rewritten
links/test/frameworks.test.ts › "ships Svelte components that compile" change detector Moved the # link into an Anchor.svelte that Heading.svelte imports: old red, new green. Deleted Heading.svelte: both red. rewritten
mark/test/frameworks.test.ts › "ships Svelte components that compile" change detector Inlined Classed.svelte into Mark.svelte and Sup.svelte: old red, new green. Deleted Classed.svelte: both red. rewritten
lint/test/mermaid.test.ts › "reports … through the limited preset and Doctor" (2 cases), the Doctor page checks change detector (docs prose) Changed both pages' import comarkUi from "comark-ui/html" to "comark-ui/vue": old red, new green. lines deleted

Tests: 3210 in the full suite, the same before and after the last commit, since it rewrites tests and deletes none. The 2669 counted earlier came from a run where five suites didn't load until docs was prepared. pnpm typecheck passes.

Kept on purpose:

  • zoom/test/zoom.test.ts "types its events on the document and the window" has no runtime assertion. It's an expectTypeOf test, and tsrs --noEmit checks it.
  • Fetch-count assertions in badge, chips, icon, zoom, diagrams, media and tabs check caching and retries, so the call count is the behavior.
  • test/workspace.test.ts, test/inline-scripts.test.ts, test/npm-trust.test.ts and doctor/parts.test.ts read source text, but they enforce the registration and release rules AGENTS.md lists.
  • ui/test/editor-vue.test.ts mocks Tiptap to pin a save race (a stale save must not overwrite an external load). That race only shows up with a controlled serializer.
  • code/test/code.test.ts checks there's no .ck-bar::before window dots, and chat/test/chat.test.ts that a running step has no animation. Both look like removal checks, but they came with the fix in fix: title tool steps from the part, and drop the step pulse and terminal dots #332.
  • Exact CSS strings in the block tests are the styles the package ships, and links-styles or block-boundary must not leak into output, since both are live internal tags.

Not checked: remark-to-comark/test/cli.test.ts "refuses to migrate with no git repository unless forced" times out at 5 s on main and on this branch while the machine is loaded. test/fuzz.test.ts seed 3 timed out once under the same load and passes alone. The ffmpeg MP4 test skips without ffmpeg.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T09:17:49.225776Z
We couldn’t complete this review. Comment @codex review to try again.
4f2cb3f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ One test coverage gap inline. No P0 or P1 findings.

Approach: Sound — checking rendered pixels and waiting past the next timer turn both test observable behavior without changing production code.

Reviewed changes — Reviewed both rewritten tests and ran both files after pnpm build: 22 passed; the ffmpeg test was skipped.

  • Tour bracket: Replaces the drawing spy with a check that the top bracket’s blue spine is above the bottom bracket’s in rendered PNGs.
  • Editor picker: Lets zero-delay timers run before verifying that the input stays attached until the picker returns a file.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/annotate/test/tour.test.ts Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@461

comark-badge

pnpm add https://pkg.pr.new/comark-badge@461

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@461

comark-cards

pnpm add https://pkg.pr.new/comark-cards@461

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@461

comark-cast

pnpm add https://pkg.pr.new/comark-cast@461

comark-charts

pnpm add https://pkg.pr.new/comark-charts@461

comark-chat

pnpm add https://pkg.pr.new/comark-chat@461

comark-chips

pnpm add https://pkg.pr.new/comark-chips@461

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@461

comark-code

pnpm add https://pkg.pr.new/comark-code@461

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@461

comark-colors

pnpm add https://pkg.pr.new/comark-colors@461

comark-comments

pnpm add https://pkg.pr.new/comark-comments@461

comark-critic

pnpm add https://pkg.pr.new/comark-critic@461

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@461

comark-details

pnpm add https://pkg.pr.new/comark-details@461

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@461

comark-diff

pnpm add https://pkg.pr.new/comark-diff@461

comark-embed

pnpm add https://pkg.pr.new/comark-embed@461

comark-fields

pnpm add https://pkg.pr.new/comark-fields@461

comark-figure

pnpm add https://pkg.pr.new/comark-figure@461

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@461

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@461

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@461

comark-github

pnpm add https://pkg.pr.new/comark-github@461

comark-icon

pnpm add https://pkg.pr.new/comark-icon@461

comark-include

pnpm add https://pkg.pr.new/comark-include@461

comark-keys

pnpm add https://pkg.pr.new/comark-keys@461

comark-links

pnpm add https://pkg.pr.new/comark-links@461

comark-linter

pnpm add https://pkg.pr.new/comark-linter@461

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@461

comark-mark

pnpm add https://pkg.pr.new/comark-mark@461

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@461

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@461

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@461

comark-media

pnpm add https://pkg.pr.new/comark-media@461

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@461

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@461

comark-outline

pnpm add https://pkg.pr.new/comark-outline@461

comark-properties

pnpm add https://pkg.pr.new/comark-properties@461

comark-qr

pnpm add https://pkg.pr.new/comark-qr@461

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@461

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@461

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@461

comark-sources

pnpm add https://pkg.pr.new/comark-sources@461

comark-steps

pnpm add https://pkg.pr.new/comark-steps@461

comark-table

pnpm add https://pkg.pr.new/comark-table@461

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@461

comark-tests

pnpm add https://pkg.pr.new/comark-tests@461

comark-time

pnpm add https://pkg.pr.new/comark-time@461

comark-ui

pnpm add https://pkg.pr.new/comark-ui@461

comark-xref

pnpm add https://pkg.pr.new/comark-xref@461

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@461

commit: 160a06e

These tests went red on refactors that kept behavior: the name of an
inlined script's function, which property a crashing lint rule read
first, the number of .svelte files in a folder, and an import path in
two Doctor pages. Each now checks what a page or caller sees, and the
docs-wording lines are gone.
@onmax onmax changed the title test: prune two tests that couldn't tell a break from a refactor test: prune tests that couldn't tell a break from a refactor Nov 18, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ One new test coverage gap inline. No P0 or P1 findings.

Reviewed changes — Reviewed the eight test files changed since 4f2cb3f. The workspace build succeeded and all 189 focused tests passed.

  • Checked inline scripts without pinning internal function names in annotate, outline, properties, and the Mermaid renderer.
  • Replaced Svelte file counts with checks for the components imported by the links and mark packages.
  • Kept linter behavior checks while dropping assertions on V8 wording and Mermaid Doctor page prose.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/links/test/frameworks.test.ts Resolved
@vite-hub

vite-hub Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Last seen running 2026-11-18T10:22:15.328Z 0s
View session Cancelled 2026-11-18T10:16:57.321Z 4m 35s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

@vite-hub
vite-hub Bot merged commit 6e4a04a into main Nov 18, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the test/prune-r6 branch November 18, 2026 10:29
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
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