Repository navigation
Test through the seams, and run the suite in 10s - #18
Merged
Merged
Conversation
The reducer tests checked state names like 'landing' and built coasting states by hand, so renaming a state broke them. They now send real events and read only the commits, the shown hue and the free turn. The flick cases from inertia.test.ts move here as finger events, and that file goes.
requests.test.ts called resolveChoice and squaresOf directly, and its malformed-input case passed on any error text. Each case now goes through agent.call, checks the notes or the reason, and checks that a refused call adds no history entry. list_squares gets its first test through the tool.
The config already grants clipboard access, so Copy tests read what landed there. The tick check looks inside the Copy button and is shown passing as well as failing. Only the refusal case still stubs writeText, restored after each test.
The link tests already open all 72 hues and reject the ones off the grid.
The ring tests counted analytics page views as a stand-in for history entries. They now read history.length. The coast tests each slept 2.6s, in series, and set the pace of the whole suite. They move to Wheel.test.tsx, which runs beside the ring tests, and use a gentler flick that coasts about 1.1s. A guard test fails if a coast outlasts the 1.5s the others wait. The suite drops from about 16s to 10s.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Tests now go through the parts a person or agent uses, so the code behind them can change without the tests breaking.
What changed in how tests check things:
The phone wheel tests used to sleep 2.6s each, one after another. A gentler flick now coasts for about 1.1s, and the tests that interrupt a coast wait 1.5s. A guard test fails if an uninterrupted coast takes longer than that, so a future change to friction can't make the waits too short without anyone noticing.
Evidence
pnpm testtook 16.0s for 135 tests. 13s of that was five coast tests run in series.After:
pnpm testtook 10.2s for 131 tests, the same on 3 runs.pnpm checkpassed 3 times in a row at 10.4s.Before trusting the rewritten tests, I broke the code on purpose. Each break below failed its test:
Merge Danger
Door: two-way
Only tests changed. Nothing in
src/outside__tests__/changed.Blast Radius: tests
The wheel tests depend on timing. If CI machines drop animation frames, the guard test is the one that fails, and the fix is to raise
COAST_REST_MS.