writing-dev-server-tests

Automate validation of hot-reloading and dev server behavior with test utilities.

95.3k|4.9k|Updated Apr 14, 2021
One-click install
npx skills add https://github.com/oven-sh/bun --skill writing-dev-server-tests-oven-sh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-dev-server-tests
Source: https://github.com/oven-sh/bun/tree/main/.claude/skills/writing-dev-server-tests
Command: npx skills add https://github.com/oven-sh/bun --skill writing-dev-server-tests-oven-sh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates and standardizes the process of writing tests for hot module replacement (HMR) and development servers to ensure reliable, fast feedback during bundling and live-reload cycles.

Core Features & Use Cases

  • Test patterns and utilities for dev server testing, including file-watching behavior and hot-reload verification.
  • Examples and categories covering common scenarios like HTML handling, React refresh, and bundling workflows.

Quick Start

Run the included test suite to validate hot-reloading and dev-server behavior.

Frequently Asked Questions about writing-dev-server-tests

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

FAQPage Schema
How do I automate testing for hot module replacement and dev server behavior?

Testing hot module replacement requires utilities that simulate file-watching and verify React refresh workflows. You can automate these validations using TypeScript-based tests within a test harness to ensure reliable live-reload cycles.

What is the best way to verify React refresh workflows in a development server?

To verify React refresh workflows, run test scenarios that exercise the dev server's hot-reload capabilities. This validates that component updates are correctly injected without losing state, providing fast feedback during bundling.

Do I need TypeScript to write dev server tests for hot-reloading?

Yes, this approach requires TypeScript-based tests present in the test directory. You also need a configured test harness to run both development and production mode tests for validating dev server behavior.

Can I test both development and production bundling modes for my dev server?

Yes, the provided test utilities support running both dev and production mode tests. This allows you to validate file-watching and hot-reload behavior in development, alongside standard bundling workflows for production builds.

Why does my dev server test fail to validate file-watching behavior properly?

Dev server tests for file-watching may fail if the test harness is not correctly configured to trigger file changes. Standardizing test patterns for hot-reload verification helps ensure consistent feedback during live-reload cycles.