tests

Write Vitest unit tests and Playwright end-to-end specs with explicit imports and strict assertions.

15.9k|914|Updated Aug 16, 2023
One-click install
npx skills add https://github.com/scalar/scalar --skill tests-scalar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tests
Source: https://github.com/scalar/scalar/tree/main/.agents/skills/tests
Command: npx skills add https://github.com/scalar/scalar --skill tests-scalar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing tests can be tedious and error-prone without a clear structure. This skill provides a disciplined approach to creating maintainable Vitest unit tests and reliable Playwright end-to-end specs, ensuring consistent quality across frontend codebases.

Core Features & Use Cases

  • Vitest-driven unit tests: enforce explicit imports, no globals, strict assertions, and flat describe blocks.
  • Playwright end-to-end coverage: scaffold dependable E2E flows that validate critical user journeys.
  • Guidance & conventions: promote consistent file naming, test organization, and reporting for faster feedback loops.

Quick Start

Generate a Vitest test suite for the module with explicit imports and strict assertions, and add a Playwright end-to-end spec for the main user flow.

Frequently Asked Questions about tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Vitest unit tests with explicit imports and strict assertions?

Structure Vitest unit tests using explicit imports, no globals, precise assertions, and flat describe blocks. This disciplined approach ensures maintainable test suites and consistent quality across frontend codebases.

How do I write Playwright end-to-end specs for frontend user workflows?

Write Playwright end-to-end specs by scaffolding dependable E2E flows that validate critical user journeys. This structured approach covers limited frontend component scenarios to ensure reliable user workflow validation.

What is the best way to organize test files for consistent Vitest and Playwright reporting?

Organize test files by promoting consistent file naming, test organization, and reporting conventions. This structured guidance enables faster feedback loops across your Vitest and Playwright test suites.

Does this testing approach enforce no globals and explicit imports for Vitest?

Yes, this testing approach enforces no globals and explicit imports for Vitest. It mandates strict assertions and descriptive test names to prevent errors and maintain codebase consistency.

Why does writing tests without clear structure lead to maintenance issues?

Writing tests without clear structure leads to maintenance issues because the process becomes tedious and error-prone. A disciplined approach with consistent file organization is required to ensure reliable quality.