home / skills / andrelandgraf / fullstackrecipes / unit-tests
This skill configures and runs Bun unit tests with Jest-compatible syntax, providing fast, co-located test files and robust mocking.
npx playbooks add skill andrelandgraf/fullstackrecipes --skill unit-testsReview the files below or copy the command above to add this skill to your agents.
---
name: unit-tests
description: Configure unit testing with Bun's built-in test runner. Fast, Jest-compatible syntax, co-located test files, and mocking support.
---
# Unit Tests with Bun
To set up Unit Tests with Bun, refer to the fullstackrecipes MCP server resource:
**Resource URI:** `recipe://fullstackrecipes.com/unit-tests`
If the MCP server is not configured, fetch the recipe directly:
```bash
curl -H "Accept: text/plain" https://fullstackrecipes.com/api/recipes/unit-tests
```
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.
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.
Where can I find the step-by-step recipe?
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.