Skip to main content
prompt GP ChatGPT

Testing taste — ChatGPT prompt: what it does, how to install

A prompt establishing pragmatic TypeScript testing habits for ChatGPT and Claude.ai. It enforces Vitest, Testcontainers, and strict UI testing standards.

Open on GitHub

What Testing taste does

This prompt supplies testing rules for TypeScript codebases, complete with team confidence scores for each guideline. It mandates vitest for unit and integration testing, keeping test files adjacent to source files as *.test.ts. HTTP traffic must be handled by msw instead of custom fetch stubs, while randomness demands fixed seeds and timers must stay frozen.

Database integration tests execute against real Postgres instances in Testcontainers, meaning in-memory SQLite setups are explicitly ruled out. End-to-end checks rely on Playwright for critical workflows. Selectors target accessible roles and names, never raw CSS classes. Sleeping inside tests is forbidden. The runner waits for explicit conditions instead.

Flaky tests are treated as bugs. The team quarantines them on the same day, then fixes or deletes them within a week. The entire unit suite must complete under one minute on a laptop.

What it helps with

  • instruct an AI assistant on TypeScript testing standards
  • switch network call mocks to msw
  • target UI elements by accessible roles in Playwright
  • isolate database tests using Postgres in Testcontainers

Example prompts for the agent

  • Generate Vitest unit tests for the authentication module following these guidelines.
  • Write a Playwright UI test that finds buttons strictly by their accessible role and name.
  • Create a database test with Postgres running in Testcontainers.

How to install Testing taste

How to use

Paste the text at the start of a chat or into project instructions

Questions about Testing taste

How to install Testing taste in ChatGPT?

ChatGPT needs no package installation: copy the prompt text into Custom Instructions or send it directly in your chat. For Claude Code, add the file at .claude/commands/prompts.csv.md.

What does Testing taste do?

The prompt defines pragmatic testing conventions for TypeScript projects. It standardizes on Vitest, disallows sleep delays, and routes HTTP mocking through msw.

How does the prompt handle database and UI testing?

Database tests run against real Postgres containers via Testcontainers instead of SQLite. UI tests run through Playwright and must select elements by accessibility roles and accessible names, ignoring CSS classes.

Source text

prompts.csv · CC0-1.0
# Testing taste of a pragmatic TypeScript team
- Use vitest as the default test runner for unit and integration tests. Confidence: 0.90
- Keep test files next to the code they cover as *.test.ts. Confidence: 0.85
- Name tests as plain sentences that describe behavior, not method names. Confidence: 0.90
- Follow arrange, act, assert with a blank line between each phase. Confidence: 0.75
- Test public behavior through the module API instead of private functions. Confidence: 0.90
- Prefer real collaborators and in-memory fakes over mocks. Confidence: 0.85
- Mock only at process boundaries such as the network, the clock and randomness. Confidence: 0.90
- Intercept HTTP with msw instead of stubbing fetch by hand. Confidence: 0.80
- Run database tests against a real Postgres in Testcontainers, not SQLite. Confidence: 0.80
- Freeze time with fake timers and pass seeds to anything random. Confidence: 0.90
- Build test data with small factory functions that accept overrides. Confidence: 0.85
- Keep snapshot tests rare and small, and review every snapshot diff. Confidence: 0.75
- Use Playwright for a thin layer of end-to-end tests on critical user flows only. Confidence: 0.85
- Select elements by role and accessible name in UI tests, never by CSS class. Confidence: 0.90
- Treat a flaky test as a bug: quarantine it the same day and fix or delete it within a week. Confidence: 0.85
- Never use sleep in tests; wait for an explicit condition instead. Confidence: 0.95
- Keep the full unit suite under one minute on a laptop. Confidence: 0.75
- Track coverage as a trend in CI but do not gate merges on a fixed percentage. Confidence: 0.70
- Add property-based tests with fast-check for parsers and pure logic. Confidence: 0.65
- Write a failing regression test before fixing every reported bug. Confidence: 0.90
- Run tests in random order to catch hidden shared state. Confidence: 0.70

© f · CC0-1.0 · f/prompts.chat

Similar prompts

All prompts for Testing and QA →

From the same set133

The whole set →
Terraform taste This prompt lays out Terraform practices for project structure, state management, and CI checks. Use it to review an infrastructure configuration or draft conventions for a repository. GP ChatGPT ★ 174,676repo stars Git Workflow taste A prompt that gives an AI assistant trunk-based habits: short-lived branches, Conventional Commits, squash-merge and a protected main. GP ChatGPT ★ 174,676repo stars Monorepo taste A prompt that hands the agent a fixed set of monorepo conventions: pnpm workspaces, Turborepo, package boundaries and shared configs. Useful when repo structure keeps drifting. GP ChatGPT ★ 174,676repo stars Go Service taste A backend engineer's Go preferences handed to the model: which router to use, how to lay out packages, how to handle errors and logs. Handy when the agent scaffolds a service. GP ChatGPT ★ 174,676repo stars Rust CLI taste A prompt that tells the model how to write a Rust command-line tool: argument parsing, error handling, output streams, tests. GP ChatGPT ★ 174,676repo stars React State Management taste A ruleset for picking React state tools: when to use useState, Zustand, Context and TanStack Query. Helps avoid overbuilt global stores and duplicated state. GP ChatGPT ★ 174,676repo stars Observability taste A prompt that tells an AI assistant how to wire traces, metrics and logs into a service. Handy when you ask a model to write instrumented code. GP ChatGPT ★ 174,676repo stars Python Packaging taste A prompt that hands the model a fixed set of Python packaging rules: pyproject.toml, src/, uv, Ruff. Useful when a new package needs one consistent style. GP ChatGPT ★ 174,676repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor