writing-bundler-tests

Write Bun bundler tests using itBundled/expectBundled APIs.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/zhcndoc/bun --skill writing-bundler-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-bundler-tests
Source: https://github.com/zhcndoc/bun/tree/main/.claude/skills/writing-bundler-tests
Command: npx skills add https://github.com/zhcndoc/bun --skill writing-bundler-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers create and maintain bundler tests for Bun using the itBundled/expectBundled utilities located in test/bundler. It standardizes test scaffolding and ensures consistency across test suites.

Core Features & Use Cases

  • Structured test templates: Provides a repeatable format for writing bundler tests with file setups, entry points, and runtime expectations.
  • Standardized conventions: Enforces the itBundled/expectBundled workflow to verify bundling results, errors, and outputs.
  • Use Case: When adding or modifying bundler, transpiler, or code transformation tests, follow the guidelines to ensure reliable and maintainable test coverage.

Quick Start

Use itBundled to create a new bundler test under test/bundler with the example category/name, and run the Bun test suite to validate the bundle 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 Bun bundler tests using itBundled?

To write Bun bundler tests, use the itBundled utility to create structured test cases under test/bundler with file setups and entry points. It provides templates to validate bundle output and runtime expectations consistently across suites.

What is the expectBundled API used for in Bun tests?

The expectBundled API verifies bundling results, errors, and outputs in Bun tests. It enforces standardized conventions to ensure reliable and maintainable test coverage for code transformation scenarios.

How do I test a Bun transpiler or code transformation?

Test a Bun transpiler by creating or modifying tests in test/bundler using itBundled and expectBundled APIs. These utilities validate that code transformation logic produces the correct bundle output and handles errors.

Do I need to put my Bun bundler tests in a specific directory?

Yes, Bun bundler tests should be placed in the test/bundler directory. This location ensures the itBundled workflow and standardized conventions are correctly applied to verify bundling results.

What's the best way to structure a bundler test for Bun?

The best way to structure a bundler test is using the itBundled template, which provides a repeatable format for setting up files, defining entry points, and specifying runtime expectations to verify bundle output.

Can I verify bundler errors and outputs with itBundled?

Yes, you can verify bundler errors and outputs by pairing itBundled with the expectBundled API. This workflow standardizes test scaffolding to check both successful bundle results and error handling.