JavaScript is disabled. Some features may not work.
tdd-typescript — Install Guide | SkillsNav
🇺🇸 English🇨🇳 中文
SkillsNav
Home

tdd-typescript

testingSafeIntermediateClaude

How to Install

Claude Code:
git clone --depth 1 https://github.com/lekman/cdn.git && cp cdn/.claude/skills/tdd-typescript ~/.claude/skills/tdd-typescript -r
--- name: tdd-typescript description: Test-driven development with Bun test framework. Use when writing new tests, creating test files, setting up mocks, writing assertions, configuring test coverage, or following the RED-GREEN-REFACTOR cycle in TypeScript. user-invocable: false --- # Test-Driven Development in TypeScript When writing tests or following TDD workflow, read and follow the policy guide: **Policy**: `docs/policies/tdd-typescript.md` ## When This Applies - Writing new test files for `src/` modules - Following the RED -> GREEN -> REFACTOR cycle - Creating mock implementations in `tests/mocks/` - Writing assertions with `bun:test` (`expect`, `describe`, `test`) - Setting up test factories or shared test utilities - Configuring coverage thresholds in `bunfig.toml` - Testing async functions, file system operations, or platform-specific code - Debugging flaky or failing tests ## Project-Specific Rules (from CLAUDE.md) - Test files mirror source path: `src/functions/delete/handler.ts` -> `tests/unit/functions/delete/handler.test.ts` - Use `test()` (not `it()`) for individual test cases - Import from `bun:test`: `describe`, `expect`, `test`, `beforeEach`, `mock` - Tests MUST NOT make network calls - Coverage thresholds: 80% line, 80% statement, 60% function ## Key Patterns - Arrange / Act / Assert structure - `realpathSync` for macOS temp directory symlink resolution - `.skipIf()` for platform-specific tests - `describe.serial` for tests using `process.chdir()` - Mock restore in `afterEach` to prevent leaks Read the full guide for assertion reference, mocking patterns, and examples.

Details

Category Coding → testing
Sourcelekman/cdn
SKILL.mdView on GitHub →
Repo StarsN/A
Est. per SkillN/A (shared across 13 skills from this repo)
DifficultyIntermediate
Risk LevelSafe

Related Skills

Works Well With

Skills from the same repository — often designed to work together