tdd-typescript

Write TypeScript tests with Bun and enforce RED-GREEN-REFACTOR workflows.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/lekman/cdn --skill tdd-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-typescript
Source: https://github.com/lekman/cdn/tree/main/.claude/skills/tdd-typescript
Command: npx skills add https://github.com/lekman/cdn --skill tdd-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type-safe test-driven development for TypeScript projects using the Bun test framework, helping teams write tests, mocks, assertions, and maintain coverage throughout the RED-GREEN-REFACTOR cycle.

Core Features & Use Cases

  • Writing new tests for src modules and ensuring deterministic test results with bun:test
  • Creating mock implementations and shared test utilities to isolate units
  • Enforcing coverage thresholds and aligning test structure with source code paths

Quick Start

Write a test for a new or existing src module using Bun's test framework and follow the RED-GREEN-REFACTOR workflow.

Frequently Asked Questions about tdd-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I start test-driven development in a TypeScript project using Bun?

To start test-driven development with Bun, write a failing test for your src module using the bun:test API, then follow the RED-GREEN-REFACTOR workflow to implement code until tests pass and coverage thresholds are met.

How do I create mocks in Bun tests to isolate TypeScript modules?

You create mocks in Bun tests by generating mock implementations and shared test utilities using the bun:test API, which isolates units and enforces deterministic test results without triggering network calls.

What is the best way to structure TypeScript test files to mirror source paths?

The best way to structure TypeScript test files is to mirror the src directory structure directly, aligning test file paths with source code paths to maintain compliance with the TDD policy guide and simplify navigation.

Why do my TypeScript TDD tests fail due to network calls?

TypeScript TDD tests fail because the Bun test workflow explicitly prevents network calls to ensure deterministic results, requiring you to isolate units and use mocks instead of live network requests.

Can I enforce code coverage thresholds while doing TDD with Bun?

Yes, you can enforce code coverage thresholds during TDD with Bun by configuring the test framework to measure coverage, ensuring your RED-GREEN-REFACTOR cycle maintains adequate test coverage across source modules.

Does the Bun test framework support RED-GREEN-REFACTOR for TypeScript?

Yes, the Bun test framework supports RED-GREEN-REFACTOR for TypeScript by providing the testing APIs needed to write failing tests first, implement the source code to make them pass, and then safely refactor the codebase.