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 name their tier with tier(), and /diff's two answers and the tests on them use an ASCII apostropheBrowse files
poteat authored on Sep 11, 2026 parent a5b0e0c · commit ee5d2e59942d
9 changed files+21 -20compared with a5b0e0c
Mmods/README.md
Mmods/diff/hooks/names/texts/git-unanswered-text.ts
Mmods/diff/hooks/names/texts/not-in-repository-text.ts
Mmods/diff/tests/boot-probe.test.ts
Mmods/diff/tests/command.test.ts
Mmods/diff/tests/pane.test.ts
Mmods/sec-default/tests/sec-default.test.ts
Mmods/telemetry/tests/telemetry.test.ts
Mmods/types/claude-code.d.ts
@@ -31,9 +31,9 @@
3131 naming its event.
3232
3333 ```ts
34-import { expect, seat, test } from 'claude-code/testing'
34+import { expect, test, tier } from 'claude-code/testing'
3535
36-seat('builtin')
36+tier('builtin')
3737
3838 test('outside a git repository /diff says so and opens nothing', async ($, on) => {
3939 const opened: string[] = []
@@ -52,7 +52,7 @@
5252 origin: { kind: 'composer' },
5353 })
5454
55- expect(text).toMatch(/isn.t in a git repository/)
55+ expect(text).toContain("isn't in a git repository")
5656 expect(opened).toEqual([])
5757 })
5858 ```
@@ -5,5 +5,5 @@
55 * cannot start has answered, and gets the not-a-repository text.
66 */
77 export const GIT_UNANSWERED_TEXT =
8- 'The diff panel couldn’t read git state — git didn’t answer; run /diff ' +
8+ "The diff panel couldn't read git state — git didn't answer; run /diff " +
99 'again'
@@ -1,6 +1,7 @@
11 /**
2- * `/diff`'s answer outside a git repository, worded as the built-in words it.
2+ * `/diff`'s answer outside a git repository, worded as the built-in words it
3+ * but for its apostrophe, which is ASCII.
34 */
45 export const NOT_IN_REPOSITORY_TEXT =
5- 'The diff panel shows git changes — the current directory isn’t in a ' +
6+ "The diff panel shows git changes — the current directory isn't in a " +
67 'git repository'
@@ -3,9 +3,9 @@
33 ProcessRunResult,
44 SessionStartInput,
55 } from 'claude-code'
6-import { clock, expect, seat, test } from 'claude-code/testing'
6+import { clock, expect, test, tier } from 'claude-code/testing'
77
8-seat('builtin')
8+tier('builtin')
99
1010 const SESSION: SessionStartInput = {
1111 surface: 'terminal',
@@ -52,7 +52,7 @@
5252 await booting
5353
5454 expect(await ran).toEqual({
55- text: expect.stringMatching(/isn.t in a git repository/),
55+ text: expect.stringContaining("isn't in a git repository"),
5656 })
5757 expect(probes, 'then one more of its own').toHaveLength(2)
5858 })
@@ -3,9 +3,9 @@
33 ProcessRunResult,
44 SessionStartInput,
55 } from 'claude-code'
6-import { expect, seat, test } from 'claude-code/testing'
6+import { expect, test, tier } from 'claude-code/testing'
77
8-seat('builtin')
8+tier('builtin')
99
1010 const SESSION: SessionStartInput = {
1111 surface: 'terminal',
@@ -37,7 +37,7 @@
3737 await $.session.start(SESSION)
3838 const { text } = await $.command.run(DIFF)
3939
40- expect(text).toMatch(/isn.t in a git repository/)
40+ expect(text).toContain("isn't in a git repository")
4141 expect(opened).toEqual([])
4242 })
4343
@@ -51,7 +51,7 @@
5151 await $.session.start(SESSION)
5252 const { text } = await $.command.run(DIFF)
5353
54- expect(text).toMatch(/git didn.t answer/)
54+ expect(text).toContain("git didn't answer")
5555 })
5656
5757 test('with the built-in holding /diff, the plugin stands down', async ($, on) => {
@@ -11,12 +11,12 @@
1111 clock,
1212 expect,
1313 memoryStore,
14- seat,
1514 test,
1615 textOf,
16+ tier,
1717 } from 'claude-code/testing'
1818
19-seat('builtin')
19+tier('builtin')
2020
2121 const SESSION: SessionStartInput = {
2222 surface: 'terminal',
@@ -7,9 +7,9 @@
77 ToolInfo,
88 } from 'claude-code'
99 import type { Plugin } from 'claude-code/testing'
10-import { expect, seat, test } from 'claude-code/testing'
10+import { expect, test, tier } from 'claude-code/testing'
1111
12-seat('prepend')
12+tier('prepend')
1313
1414 const SESSION: SessionStartInput = {
1515 surface: 'terminal',
@@ -116,7 +116,7 @@
116116 }
117117
118118 /**
119- * The organization's own plugin, seated last, which signs the section.
119+ * The organization's own plugin, in its last tier, which signs the section.
120120 */
121121 const signing: Plugin = {
122122 name: 'signing',
@@ -6,11 +6,11 @@
66 SessionAuthorization,
77 } from 'claude-code'
88 import type { Plugin } from 'claude-code/testing'
9-import { expect, memoryEnv, seat, test } from 'claude-code/testing'
9+import { expect, memoryEnv, test, tier } from 'claude-code/testing'
1010
1111 import type { LogEntry } from '../hooks/telemetry-types'
1212
13-seat('builtin')
13+tier('builtin')
1414
1515 const BEARER: SessionAuthorization = { handle: 'the-handle', kind: 'bearer' }
1616 const ACCEPTED: HttpResponse = { status: 200, ok: true, headers: {}, text: '' }
Large file, diff not shown.