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
| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | naming its event. |
| 32 | 32 | |
| 33 | 33 | ```ts |
| 34 | -import { expect, seat, test } from 'claude-code/testing' | |
| 34 | +import { expect, test, tier } from 'claude-code/testing' | |
| 35 | 35 | |
| 36 | -seat('builtin') | |
| 36 | +tier('builtin') | |
| 37 | 37 | |
| 38 | 38 | test('outside a git repository /diff says so and opens nothing', async ($, on) => { |
| 39 | 39 | const opened: string[] = [] |
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | origin: { kind: 'composer' }, |
| 53 | 53 | }) |
| 54 | 54 | |
| 55 | - expect(text).toMatch(/isn.t in a git repository/) | |
| 55 | + expect(text).toContain("isn't in a git repository") | |
| 56 | 56 | expect(opened).toEqual([]) |
| 57 | 57 | }) |
| 58 | 58 | ``` |
| @@ -5,5 +5,5 @@ | ||
| 5 | 5 | * cannot start has answered, and gets the not-a-repository text. |
| 6 | 6 | */ |
| 7 | 7 | 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 " + | |
| 9 | 9 | 'again' |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | /** |
| 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. | |
| 3 | 4 | */ |
| 4 | 5 | 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 " + | |
| 6 | 7 | 'git repository' |
| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | ProcessRunResult, |
| 4 | 4 | SessionStartInput, |
| 5 | 5 | } from 'claude-code' |
| 6 | -import { clock, expect, seat, test } from 'claude-code/testing' | |
| 6 | +import { clock, expect, test, tier } from 'claude-code/testing' | |
| 7 | 7 | |
| 8 | -seat('builtin') | |
| 8 | +tier('builtin') | |
| 9 | 9 | |
| 10 | 10 | const SESSION: SessionStartInput = { |
| 11 | 11 | surface: 'terminal', |
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | await booting |
| 53 | 53 | |
| 54 | 54 | expect(await ran).toEqual({ |
| 55 | - text: expect.stringMatching(/isn.t in a git repository/), | |
| 55 | + text: expect.stringContaining("isn't in a git repository"), | |
| 56 | 56 | }) |
| 57 | 57 | expect(probes, 'then one more of its own').toHaveLength(2) |
| 58 | 58 | }) |
| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | ProcessRunResult, |
| 4 | 4 | SessionStartInput, |
| 5 | 5 | } from 'claude-code' |
| 6 | -import { expect, seat, test } from 'claude-code/testing' | |
| 6 | +import { expect, test, tier } from 'claude-code/testing' | |
| 7 | 7 | |
| 8 | -seat('builtin') | |
| 8 | +tier('builtin') | |
| 9 | 9 | |
| 10 | 10 | const SESSION: SessionStartInput = { |
| 11 | 11 | surface: 'terminal', |
| @@ -37,7 +37,7 @@ | ||
| 37 | 37 | await $.session.start(SESSION) |
| 38 | 38 | const { text } = await $.command.run(DIFF) |
| 39 | 39 | |
| 40 | - expect(text).toMatch(/isn.t in a git repository/) | |
| 40 | + expect(text).toContain("isn't in a git repository") | |
| 41 | 41 | expect(opened).toEqual([]) |
| 42 | 42 | }) |
| 43 | 43 | |
| @@ -51,7 +51,7 @@ | ||
| 51 | 51 | await $.session.start(SESSION) |
| 52 | 52 | const { text } = await $.command.run(DIFF) |
| 53 | 53 | |
| 54 | - expect(text).toMatch(/git didn.t answer/) | |
| 54 | + expect(text).toContain("git didn't answer") | |
| 55 | 55 | }) |
| 56 | 56 | |
| 57 | 57 | test('with the built-in holding /diff, the plugin stands down', async ($, on) => { |
| @@ -11,12 +11,12 @@ | ||
| 11 | 11 | clock, |
| 12 | 12 | expect, |
| 13 | 13 | memoryStore, |
| 14 | - seat, | |
| 15 | 14 | test, |
| 16 | 15 | textOf, |
| 16 | + tier, | |
| 17 | 17 | } from 'claude-code/testing' |
| 18 | 18 | |
| 19 | -seat('builtin') | |
| 19 | +tier('builtin') | |
| 20 | 20 | |
| 21 | 21 | const SESSION: SessionStartInput = { |
| 22 | 22 | surface: 'terminal', |
| @@ -7,9 +7,9 @@ | ||
| 7 | 7 | ToolInfo, |
| 8 | 8 | } from 'claude-code' |
| 9 | 9 | 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' | |
| 11 | 11 | |
| 12 | -seat('prepend') | |
| 12 | +tier('prepend') | |
| 13 | 13 | |
| 14 | 14 | const SESSION: SessionStartInput = { |
| 15 | 15 | surface: 'terminal', |
| @@ -116,7 +116,7 @@ | ||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 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. | |
| 120 | 120 | */ |
| 121 | 121 | const signing: Plugin = { |
| 122 | 122 | name: 'signing', |
| @@ -6,11 +6,11 @@ | ||
| 6 | 6 | SessionAuthorization, |
| 7 | 7 | } from 'claude-code' |
| 8 | 8 | 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' | |
| 10 | 10 | |
| 11 | 11 | import type { LogEntry } from '../hooks/telemetry-types' |
| 12 | 12 | |
| 13 | -seat('builtin') | |
| 13 | +tier('builtin') | |
| 14 | 14 | |
| 15 | 15 | const BEARER: SessionAuthorization = { handle: 'the-handle', kind: 'bearer' } |
| 16 | 16 | const ACCEPTED: HttpResponse = { status: 200, ok: true, headers: {}, text: '' } |
Large file, diff not shown.