con un clic
testing
// Write and run unit tests with Vitest. Use when writing tests, adding test coverage, debugging test failures, or when the user mentions testing, vitest, unit tests, or test-driven development.
// Write and run unit tests with Vitest. Use when writing tests, adding test coverage, debugging test failures, or when the user mentions testing, vitest, unit tests, or test-driven development.
Release a new version of the itsvertical npm package. Bump version, build, publish, and create a GitHub release. Use when the user mentions releasing, publishing, cutting a release, or shipping a new version.
Manage projects with the Vertical board using the itsvertical CLI. Create projects, add tasks, organize boxes, split layers, and track progress. Use when the user mentions Vertical, project management, boxes, slices, .vertical files, or itsvertical.
Create, manage, and debug Claude Code Agent Skills. Use when creating new skills, debugging skill activation issues, writing SKILL.md files, managing skill structure, or learning about Claude Code skills. Helps with personal skills, project skills, YAML frontmatter, descriptions, and troubleshooting.
| name | testing |
| description | Write and run unit tests with Vitest. Use when writing tests, adding test coverage, debugging test failures, or when the user mentions testing, vitest, unit tests, or test-driven development. |
| metadata | {"internal":true} |
Unit tests use Vitest. Tests are co-located with source files as *.test.ts.
pnpm run test # Run all tests once
pnpm run test:watch # Run in watch mode
pnpm run test -- app/state/reducer.test.ts # Run a specific file
Follow the Red-Green-Refactor cycle:
toContain, toContainEqual, toEqual over manual .some() or .find() checksreducer.ts → reducer.test.tsimport { describe, expect, it } from 'vitest'describe block per subject (function name)it names that read as sentencesimport { describe, expect, it } from 'vitest'
import { boardReducer } from './reducer'
import type { BoardState } from './types'
describe('boardReducer', () => {
describe('ACTION_NAME', () => {
it('does something specific', () => {
const state: BoardState = { /* minimal fixture */ }
const result = boardReducer(state, { type: 'ACTION_NAME', /* params */ })
expect(result.someField).toBe(expectedValue)
})
})
})
Build minimal state objects inline using helper functions at the top of each test file:
function makeState(overrides: Partial<BoardState> = {}): BoardState {
return {
project: { id: 'project-1', name: 'Test' },
slices: [],
layers: [],
tasks: [],
...overrides,
}
}
Similar helpers for makeTask, makeLayer, makeSlice as needed.
The ~/ path alias works in test files:
import { serialize, deserialize } from '~/file/format'
pnpm run test && pnpm run lint && pnpm run tsc && pnpm run build
For concrete test examples, see references/examples.md.