Vitest Browser Testing

Use when writing, reviewing, or refactoring tests that run in Vitest Browser Mode, especially tests using page, userEvent, expect.element, browser locators, polling assertions, or real DOM interactions.

qualcomm Updated 256 repo stars

File contents

Vitest Browser Testing

Use this skill for browser-mode tests that should assert public behavior through real DOM queries and user interactions.

Required References

Before writing or reviewing Vitest Browser tests, read:

  • references/behavior-testing.md
  • references/vitest-browser-testing.md

Workflow

  1. Match the local project's Vitest Browser import style and render helper.
  2. Query through page by role, label, text, value, or placeholder before using test IDs.
  3. Drive behavior through userEvent or public browser interactions.
  4. Assert DOM state with await expect.element(...) and async side effects with expect.poll(...).
  5. Reject selectors, classes, SVG internals, and internal data attributes unless they are documented public contracts.

qualcomm/qualcomm-ui commit 736a59063e

Frequently asked questions

npx get-skill add qualcomm/vitest-browser-testing