write-tests

Generate unit tests for React and TypeScript files using Bun test runner.

Updated Jul 25, 2025
One-click install
npx skills add https://github.com/narrative-io/data-collaboration-mcp --skill write-tests-narrative-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/narrative-io/data-collaboration-mcp/tree/main/.claude/skills/write-tests
Command: npx skills add https://github.com/narrative-io/data-collaboration-mcp --skill write-tests-narrative-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to generating comprehensive unit tests for React and TypeScript projects using Bun, ensuring reliable code with proper mocks and coverage targets.

Core Features & Use Cases

  • Generates test scaffolds for .ts and .tsx files using Bun test runner with proper mocking and isolation.
  • Enforces 80% code coverage targets and organizes tests in a mirrored workspace structure.
  • Best suited for maintaining high-quality front-end components and utilities during rapid development.

Quick Start

Create tests for the target file(s) and run bun test --coverage to confirm improvements.

Frequently Asked Questions about write-tests

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

FAQPage Schema
How do I generate unit tests for React and TypeScript files in a monorepo?

To generate unit tests for React and TypeScript files in a monorepo, apply this Skill to your target .ts and .tsx files. It automatically scaffolds tests and places them in mirrored workspace folders to maintain structural organization.

Does Bun test runner support auto-generated mocks for TypeScript components?

Yes, the Bun test runner supports auto-generated mocks for TypeScript components. This Skill enforces proper mocking and isolation when scaffolding tests for your React and TypeScript files.

Can I enforce an 80% code coverage target for React and TypeScript using Bun?

Yes, you can enforce an 80% code coverage target for React and TypeScript using Bun. This Skill structures tests to meet this threshold, which you can verify by running the command bun test --coverage.

What is the best way to structure unit tests in a TypeScript monorepo?

The best way to structure unit tests in a TypeScript monorepo is to mirror the source structure. This Skill organizes tests under corresponding tests folders, covering both .ts and .tsx files for maintainable front-end components.

When do I need to auto-generate test scaffolds for my React utilities?

You need to auto-generate test scaffolds for React utilities during rapid development to ensure high-quality and reliable code. This approach provides structured test organization and proper isolation without slowing down feature delivery.