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.
TypeScript
import { describe, expect, test, tier } from 'claude-code/testing'
import Todos from '../../hooks/todos'
import Fixtures from '../fixtures'
tier('builtin')
describe('todo-progress-of', () => {
test('the latest TodoWrite decides: completed over total', () => {
expect(
Todos.todoProgressOf([
Fixtures.todoWriteOf(['pending', 'pending']),
Fixtures.todoWriteOf(['completed', 'in_progress', 'pending']),
]),
).toEqual({ done: 1, total: 3 })
})
test('no TodoWrite yet reads as an empty list', () => {
expect(
Todos.todoProgressOf([{ role: 'user', text: 'hi', toolUses: [] }]),
).toEqual({
done: 0,
total: 0,
})
})
})