using-tests_skill

This skill helps you implement and manage a robust test strategy across Playwright, API integration, and unit tests for fast, isolated runs.
  • 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 using-tests

  • SKILL.md6.9 KB

Overview

This skill documents a practical testing strategy and workflow for full‑stack TypeScript AI apps. It prioritizes Playwright for browser-level verification, uses integration tests for API and server behavior, and reserves unit tests for complex pure logic. Tests run in parallel against isolated Neon database branches to prevent interference between suites.

How this skill works

Tests are organized by type and location: Playwright specs under tests/playwright, integration tests under tests/integration, and co‑located unit tests next to source files. Each CI run creates a fresh Neon branch (schema only) that auto‑deletes after one hour, so suites can run concurrently without shared state. Recommended commands run all tests or only a specific category (playwright, integration, unit).

When to use it

  • Use Playwright for user interactions, visual feedback, multi‑step flows, form validation, protected routes, and accessibility checks.
  • Use integration tests for direct API responses, database state verification, and server logic where the UI layer is unnecessary or slow.
  • Use unit tests only for pure functions with complex edge cases, schema validation, and data transformation logic.
  • Run Playwright when you need end‑to‑end confidence that UI and backend integrate correctly.
  • Run integration tests when you need fast, reliable checks of API contracts and side effects.

Best practices

  • Pick the highest‑value test type: favor Playwright, then integration, then unit for isolated logic.
  • Keep test data isolated: each spec file should create unique users/resources to avoid collisions.
  • Import API route handlers directly in integration tests for speed and determinism.
  • Name and locate tests consistently: tests/playwright/{feature}.spec.ts and tests/integration/{feature}.test.ts.
  • Avoid relying on global state or preexisting DB contents; let the Neon branch TTL handle cleanup.

Example use cases

  • Playwright test for sign‑in flow with error handling, redirects, and session persistence.
  • Integration test to validate an API route returns correct status codes and JSON structure.
  • Playwright test for chat creation and deletion including confirmation dialogs and UI updates.
  • Unit test for a complex data transformation or assertion helper with many edge cases.
  • Integration test that verifies a user creation endpoint populates the database as expected.

FAQ

Each test run creates an isolated Neon schema branch that is auto‑deleted after one hour, so tests never run against production data.

When should I import route handlers instead of hitting HTTP endpoints?

Import route handlers directly in integration tests for faster, more reliable checks of server logic and responses without the overhead of HTTP.

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