testing-expert

Guide Vitest and Playwright test creation for JavaScript/TypeScript projects.

2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/traylinx/switchAILocal --skill testing-expert-traylinx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-expert
Source: https://github.com/traylinx/switchAILocal/tree/main/plugins/cortex-router/skills/testing-expert
Command: npx skills add https://github.com/traylinx/switchAILocal --skill testing-expert-traylinx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides teams in implementing robust testing strategies for JavaScript/TypeScript projects, reducing bugs and speeding delivery.

Core Features & Use Cases

  • Unit Testing: Vitest for JS/TS projects to ensure correctness at the code level.
  • End-to-End Testing: Playwright coverage for browser interactions and flows.
  • TDD & Mocking: Guidance on Test-Driven Development and effective mocks/stubs to avoid flaky tests.
  • Quality Coaching: Best practices for flaky tests, test coverage targets, and CI integration.

Quick Start

Define a test strategy using Vitest and Playwright: write a failing unit test, implement the code, and run tests with npm test. Then add a Playwright end-to-end test for a critical user flow and run it in CI to verify stability.

Frequently Asked Questions about testing-expert

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

FAQPage Schema
How do I set up unit testing for JavaScript projects with Vitest?

Unit testing with Vitest involves writing test files alongside your source code, defining assertions for individual functions, and running npm test to execute them. Vitest provides fast feedback on code correctness and integrates seamlessly with modern JavaScript and TypeScript projects.

What's the best way to write end-to-end tests for web applications?

End-to-end testing with Playwright automates real browser interactions by simulating user flows—clicks, form submissions, navigation—across your application. Tests verify that critical user journeys work correctly in actual browser environments, catching integration issues that unit tests miss.

How do I implement Test-Driven Development to reduce flaky tests?

Test-Driven Development writes failing tests first, then implements code to pass them, ensuring test coverage from the start. Combined with proper mocking and stub strategies, TDD eliminates flaky tests by making assertions deterministic and preventing hidden dependencies.

Can I run Vitest and Playwright tests together in a CI pipeline?

Yes. Vitest runs unit and integration tests locally or in CI, while Playwright handles end-to-end browser automation in the same pipeline. Combining both in CI provides layered quality assurance—fast unit feedback plus real-world browser verification before deployment.

What test coverage targets should I aim for in JavaScript projects?

Coverage targets depend on project risk; critical paths warrant 80–90% line coverage, while utilities may need less. Vitest reports coverage automatically, and guidance on balancing coverage with maintenance cost prevents over-testing and test bloat.

Why are my Playwright tests failing inconsistently in CI?

Flaky Playwright tests typically stem from timing issues, unhandled async operations, or environment differences between local and CI. Best practices include explicit waits for elements, avoiding sleep commands, and running tests in isolated browser contexts to ensure deterministic behavior.