testing

Write and run automated tests with Pest, Vitest, and Playwright.

1|Updated Dec 14, 2025
One-click install
npx skills add https://github.com/mgkyawzayya/claude-code-usage-flow --skill testing-mgkyawzayya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/mgkyawzayya/claude-code-usage-flow/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/mgkyawzayya/claude-code-usage-flow --skill testing-mgkyawzayya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establish a rigorous test-driven workflow across PHP and JS ecosystems to catch defects early.

Core Features & Use Cases

  • TDD workflow: Red, Green, Refactor loop for PHP Pest and JS Vitest.
  • Cross-stack tests: PHP, JS, and Playwright patterns.
  • Test commands: Guidance for composer/phpunit, npm, and Playwright.

Quick Start

Write a failing test, watch it fail, implement minimal code, then run full test suite.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write tests using TDD with Pest and Vitest?

TDD with Pest and Vitest follows the Red-Green-Refactor loop: write a failing test first, implement minimal code to pass it, then refactor. Pest handles PHP unit and feature tests; Vitest runs JavaScript tests. Both frameworks integrate with your test commands (composer test, npm run test) to validate your implementation continuously.

Can I use TDD for end-to-end testing with Playwright?

Yes. Playwright enables E2E test scenarios within a TDD workflow by automating browser interactions. You write failing E2E tests first, implement features to satisfy them, then refactor. This applies the same Red-Green-Refactor cycle across your full stack alongside unit and component tests.

What's the difference between unit tests, component tests, and E2E tests?

Unit tests validate individual functions or methods in isolation using Pest or Vitest. Component tests verify UI components render and behave correctly. E2E tests use Playwright to test complete workflows from the user's perspective. TDD applies to all three, catching defects at different layers of your application.

How do I know if my test coverage is sufficient?

Run your full test suite with coverage reporting (composer test or npm run test with coverage flags). TDD improves coverage by design—writing tests before code ensures every feature has validation. Monitor coverage metrics and identify untested paths, then write tests to close gaps and maintain confidence.

Can I apply TDD across both PHP and JavaScript in the same project?

Yes. Use Pest for PHP testing (unit, feature tests) and Vitest for JavaScript testing, each with their native test runners. Execute both suites separately (composer test, npm run test) or combine them in CI/CD. This keeps your TDD feedback loop consistent across your full stack.

What commands do I run to execute tests in a TDD workflow?

For PHP: composer test or php artisan test with Pest. For JavaScript: npm run test with Vitest. For E2E: Playwright runs via npm scripts. Execute these commands repeatedly in your TDD loop—after writing a failing test, after implementing code, and after refactoring—to validate each cycle.