spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

mods: tests settle a started dispatch with clock.settle()Browse files
poteat authored on Sep 12, 2026 parent 485170e · commit bf4322ffe250
3 changed files+7 -5compared with 485170e
Mmods/README.md
Mmods/diff/tests/register.test.ts
Mmods/types/claude-code.d.ts
@@ -72,8 +72,10 @@
7272 it: `mock.env(on, variables)` for `$.env`, `mock.store(on, entries)` for
7373 `$.store`, and `mock.clock(on)` for `$.clock`, whose `advance(ms)` resolves
7474 every wait the mod asked for (`$.clock.sleep`, `after`, `every`) as the clock
75-crosses it. `$.ui.press({ plugin, key })` presses a `Button` the test
76-rendered, as a click in the terminal does.
75+crosses it. To see what a dispatch does before it answers, start it
76+unawaited, `await clock.settle()`, then look: the clock stays where it was.
77+`$.ui.press({ plugin, key })` presses a `Button` the test rendered, as a
78+click in the terminal does.
7779
7880 `tsc -p mods/tsconfig.json` typechecks every mod's hooks and tests against
7981 `types/` and each mod's own `types/` contract.
@@ -24,11 +24,11 @@
2424
2525 const booting = $.session.start(Fixtures.SESSION)
2626
27- await clock.advance(0)
27+ await clock.settle()
2828
2929 const ran = $.command.run(Fixtures.DIFF)
3030
31- await clock.advance(0)
31+ await clock.settle()
3232
3333 expect(probes, 'the boot probe, which /diff joined').toHaveLength(1)
3434
@@ -148,7 +148,7 @@
148148 element: 'close',
149149 })
150150
151- await world.clock.advance(0)
151+ await world.clock.settle()
152152
153153 expect(world.closed.map(pane => pane.id)).toEqual(['diff'])
154154 expect(await $.command.run(Fixtures.DIFF)).toEqual({})
Large file, diff not shown.