unit-tests_skill

This skill configures and runs Bun unit tests with Jest-compatible syntax, providing fast, co-located test files and robust mocking.
  • TypeScript

8

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill andrelandgraf/fullstackrecipes --skill unit-tests

  • SKILL.md495 B

Overview

This skill configures fast, Jest-compatible unit testing using Bun's built-in test runner for TypeScript projects. It provides co-located test file conventions, mocking support, and a concise recipe to get tests running quickly in full stack AI apps. The setup focuses on production-ready patterns and repeatable steps.

How this skill works

The skill installs and configures Bun's test runner and applies a Jest-like API so existing tests require minimal changes. It places tests next to implementation files, enables built-in mocking and snapshot features, and includes a recipe URI for step-by-step instructions. The result is a lightweight test environment with fast startup and native TypeScript compatibility.

When to use it

  • You need fast local unit test feedback for TypeScript services or libraries.
  • You want to reuse Jest-style tests while moving to Bun for performance.
  • You prefer co-located tests alongside implementation files for clarity.
  • You need built-in mocking and snapshot capabilities without heavy tooling.
  • You want a simple, reproducible recipe for CI and developer workstations.

Best practices

  • Co-locate test files with implementation using .test.ts or .spec.ts suffixes.
  • Keep tests focused and fast: mock external services and avoid slow integration calls.
  • Use Bun's snapshot testing for UI-like outputs and stable string comparisons.
  • Run tests locally with Bun and include the test command in CI pipelines.
  • Maintain Jest-compatible APIs to ease migration and reuse existing test code.

Example use cases

  • Adding unit tests to a new TypeScript service in a full stack AI app.
  • Migrating existing Jest tests to Bun to reduce CI and developer test time.
  • Creating fast feedback loops for model input validation and utility functions.
  • Mocking external APIs and databases during component-level testing.
  • Standardizing test layout across a monorepo using co-located test files.

FAQ

Follow the recipe at recipe://fullstackrecipes.com/unit-tests or fetch it with curl: curl -H "Accept: text/plain" https://fullstackrecipes.com/api/recipes/unit-tests

Do I need to rewrite my Jest tests?

Most Jest-style tests work as-is thanks to Bun's Jest-compatible API, though minor adjustments may be needed for environment-specific globals.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
unit-tests skill by andrelandgraf/fullstackrecipes | VeilStrat