home / skills / andrelandgraf / fullstackrecipes / testing
This skill helps you implement a complete testing setup with Neon branches, Playwright browser tests, and unit/integration tests for robust fullstack apps.
npx playbooks add skill andrelandgraf/fullstackrecipes --skill testingReview the files below or copy the command above to add this skill to your agents.
---
name: testing
description: Complete testing setup with Neon database branching, Playwright browser tests, integration tests, and unit tests. Isolated branches with automatic TTL cleanup.
---
# Testing
Complete testing setup with Neon database branching, Playwright browser tests, integration tests, and unit tests. Isolated branches with automatic TTL cleanup.
## Prerequisites
Complete these recipes first (in order):
### Type-Safe Environment Configuration
Type-safe environment variable validation using Zod with a Drizzle-like schema API. Supports server/public fields, feature flags, either-or constraints, and client-side protection.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/config-schema-setup
```
### Neon + Drizzle Setup
Connect a Next.js app to Neon Postgres using Drizzle ORM with optimized connection pooling for Vercel serverless functions.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/neon-drizzle-setup
```
## Cookbook - Complete These Recipes in Order
### Neon Test Branches
Create isolated Neon database branches for testing. Schema-only branches with auto-cleanup via TTL, test server orchestration, and environment variable management.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/neon-test-branches
```
### Unit Tests with Bun
Configure unit testing with Bun's built-in test runner. Fast, Jest-compatible syntax, co-located test files, and mocking support.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/unit-tests
```
### Integration Tests
Test API routes by importing handlers directly with Bun's test runner. Fast, reliable tests without HTTP overhead.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/integration-tests
```
### Browser Tests with Playwright
End-to-end browser testing with Playwright. Test user interactions, form validation, navigation, and visual feedback with full browser automation.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/playwright-tests
```
### Working with Tests
Testing strategy and workflow. Tests run in parallel with isolated data per suite. Prioritize Playwright for UI, integration tests for APIs, unit tests for logic.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/using-tests
```
This skill provides a complete testing setup for TypeScript full-stack apps using Neon database branching, Playwright browser tests, integration tests, and unit tests. It creates isolated Neon branches with automatic TTL cleanup and ties testing workflows together for reliable, repeatable CI and local runs. The setup favors fast feedback and safe parallel execution across suites.
The setup provisions schema-only Neon test branches on demand, automatically expires them via TTL, and injects branch connection details into test environments. Unit tests run with Bun’s fast test runner, integration tests call API handlers directly to avoid HTTP overhead, and Playwright performs end-to-end browser automation. Tests run in parallel with isolated data per suite to prevent cross-test interference.
How are Neon test branches cleaned up?
Branches are created as schema-only with a TTL policy so they automatically expire and free resources without manual intervention.
Why use Bun for tests instead of Jest or Vitest?
Bun provides a very fast built-in test runner with Jest-compatible syntax and co-located tests, reducing feedback loop time while remaining familiar.