component-testing
Component Testing
Vitest Browser Mode with Playwright. Tests run in real Chromium — every DOM API, CSS layout, and browser behavior is authentic.
Conventions
- Co-locate tests:
foo.browser.test.tsxnext tofoo.tsx - Always wrap in
describenamed after the component - Use
test, notit render()is async — alwaysawaitit- Test behavior through rendered output, not implementation details
- Do NOT test shadcn/ui primitives — only test your own components that compose them
describe("SearchFilter", () => {
test("filters results on input change", async () => { ... });
test("shows empty state when no matches", async () => { ... });
});
More from kvnwolf/devtools
commit
Wraps up work by syncing documentation, committing, pushing, and opening a pull request. Use when committing code, finishing a task, pushing changes, or creating a PR.
10base
Scaffolds a new TypeScript project from scratch. Use when starting a new project, bootstrapping a codebase, or setting up a project from zero.
10unit-testing
Writes unit tests following behavior-driven conventions with vitest. Use when creating tests, adding test coverage, or writing regression tests.
9convex
Provides instructions for working with Convex backend projects. Use when setting up Convex, creating queries/mutations/actions, consuming Convex data from React, defining tables, testing Convex functions, configuring environment variables, or prefetching data in route loaders.
7e2e-testing
Writes end-to-end tests with Playwright Test for full user flow verification. Use when adding, modifying, or removing user flows in an application. Do not use for isolated component behavior — use component-testing instead.
5tanstack-start
Provides instructions for working with TanStack Start projects. Use when setting up, configuring, developing, creating routes, or creating server functions in a TanStack Start application.
5