writing-bundler-tests

Write and maintain Bun bundler tests using itBundled/expectBundled.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bundler testing in Bun can be brittle and hard to scale; this skill provides a structured approach to writing and organizing tests with itBundled/expectBundled to ensure consistent bundling behavior.

Core Features & Use Cases

  • Standardized test templates using itBundled/expectBundled to verify bundling outputs across multiple scenarios.
  • Clear guidelines for organizing test files, entry points, and runtime assertions to catch regressions early.
  • Practical patterns for common bundling scenarios (ESM/CJS interop, option variations, and error cases) with repeatable results.

Quick Start

Create a test using itBundled in test/bundler and run bun test to verify the bundler output.

Frequently Asked Questions about writing-bundler-tests

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

FAQPage Schema
How do I write reliable bundler tests in Bun?

Writing reliable bundler tests in Bun involves using itBundled and expectBundled to verify bundling outputs. This approach provides standardized templates for setting up multi-file scenarios and runtime assertions to ensure consistent behavior.

What is the best way to test ESM and CJS interop when bundling in Bun?

The best way to test ESM and CJS interop is using itBundled to apply practical patterns for common bundling scenarios. You can configure option variations and runtime assertions to catch regressions early and ensure repeatable results.

How do I organize test files and entry points for Bun bundler scenarios?

Organizing test files and entry points for Bun bundler scenarios involves placing tests in a test/bundler directory. The itBundled skill provides clear guidelines for structuring multi-file setups to validate runtime behavior effectively.

Can I use itBundled to test bundler error cases in Bun projects?

Yes, you can use itBundled to test bundler error cases in Bun projects. The skill provides practical patterns for common bundling scenarios, including option variations and error cases, to maintain repeatable test results.

Why are my Bun bundler tests brittle and hard to scale?

Bun bundler tests become brittle and hard to scale without a structured approach to organizing test files and runtime assertions. Using itBundled and expectBundled provides standardized templates to catch regressions early and ensure consistent bundling behavior.