test-runnerWrite, run, and manage unit, integration, and E2E tests across TypeScript, Python, and Swift using recommended frameworks.
Install via ClawdBot CLI:
clawdbot install cmanfre7/test-runnerWrite and run tests across languages and frameworks.
| Language | Unit Tests | Integration | E2E |
|----------|-----------|-------------|-----|
| TypeScript/JS | Vitest (preferred), Jest | Supertest | Playwright |
| Python | pytest | pytest + httpx | Playwright |
| Swift | XCTest | XCTest | XCUITest |
npm install -D vitest @testing-library/react @testing-library/jest-dom
// vitest.config.ts
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
setupFiles: './tests/setup.ts',
},
})
npx vitest # Watch mode
npx vitest run # Single run
npx vitest --coverage # With coverage
npm install -D jest @types/jest ts-jest
npx jest # Run all
npx jest --watch # Watch mode
npx jest --coverage # With coverage
npx jest path/to/test # Single file
uv pip install pytest pytest-cov pytest-asyncio httpx
pytest # Run all
pytest -v # Verbose
pytest -x # Stop on first failure
pytest --cov=app # With coverage
pytest tests/test_api.py -k "test_login" # Specific test
pytest --tb=short # Short tracebacks
swift test # Run all tests
swift test --filter MyTests # Specific test suite
swift test --parallel # Parallel execution
npm install -D @playwright/test
npx playwright install
npx playwright test # Run all
npx playwright test --headed # With browser visible
npx playwright test --debug # Debug mode
npx playwright test --project=chromium # Specific browser
npx playwright show-report # View HTML report
βββββββββββ βββββββββββ ββββββββββββ
β Write ββββββΆβ Write ββββββΆβ Refactor ββββ
β Test β β Code β β Code β β
β (Red) β β (Green) β β β β
βββββββββββ βββββββββββ ββββββββββββ β
β² β
ββββββββββββββββββββββββββββββββββββββββββββ
test('calculates total with tax', () => {
// Arrange
const cart = new Cart([{ price: 100, qty: 2 }]);
// Act
const total = cart.totalWithTax(0.08);
// Assert
expect(total).toBe(216);
});
test('fetches user data', async () => {
const user = await getUser('123');
expect(user.name).toBe('Colt');
});
import { vi } from 'vitest';
const mockFetch = vi.fn().mockResolvedValue({
json: () => Promise.resolve({ id: 1, name: 'Test' }),
});
vi.stubGlobal('fetch', mockFetch);
import pytest
from httpx import AsyncClient
from app.main import app
@pytest.mark.asyncio
async def test_get_users():
async with AsyncClient(app=app, base_url="http://test") as client:
response = await client.get("/users")
assert response.status_code == 200
assert isinstance(response.json(), list)
import { render, screen, fireEvent } from '@testing-library/react';
import { Button } from './Button';
test('calls onClick when clicked', () => {
const handleClick = vi.fn();
render(<Button onClick={handleClick}>Click me</Button>);
fireEvent.click(screen.getByText('Click me'));
expect(handleClick).toHaveBeenCalledOnce();
});
# JavaScript/TypeScript
npx vitest --coverage # Vitest (uses v8 or istanbul)
npx jest --coverage # Jest
# Python
pytest --cov=app --cov-report=html # HTML report
pytest --cov=app --cov-report=term # Terminal output
pytest --cov=app --cov-fail-under=80 # Fail if < 80%
# View HTML coverage report
open coverage/index.html # macOS
open htmlcov/index.html # Python
Always test:
Don't bother testing:
Generated Mar 1, 2026
Developers building web applications with TypeScript/JavaScript backends and React frontends can use Vitest for unit testing components, Supertest for API integration tests, and Playwright for end-to-end browser testing. This ensures robust functionality across the stack, from UI interactions to server responses.
Teams creating microservices in Python can leverage pytest for unit testing business logic and httpx for integration testing of API endpoints. This setup validates service reliability and data handling, crucial for scalable backend systems in e-commerce or finance.
iOS developers using Swift can employ XCTest for unit and integration tests, with XCUITest for end-to-end UI testing on simulators or devices. This ensures app stability and user experience, essential for consumer-facing applications in retail or healthcare.
QA engineers testing web applications across multiple browsers can use Playwright to automate end-to-end scenarios, such as user login flows or checkout processes. This helps catch UI bugs and performance issues before deployment in sectors like e-commerce or education.
Organizations upgrading legacy codebases to modern frameworks can adopt TDD workflows with this skill to write tests first, ensuring new features integrate smoothly without breaking existing functionality. This is common in industries like insurance or government services.
A software-as-a-service company can use this skill to maintain high code quality and reduce bugs, leading to better customer retention and lower support costs. Automated testing across languages ensures rapid feature deployment and scalability.
A tech consulting firm can offer testing services to clients, helping them implement TDD and automated testing pipelines. This generates revenue through project-based contracts or retainer models, improving client software reliability.
Maintainers of open-source projects can leverage this skill to enforce testing standards, attracting contributors and ensuring stability. Revenue may come from donations, sponsorships, or premium support tiers for enterprise users.
π¬ Integration Tip
Integrate this skill into CI/CD pipelines by adding test commands to build scripts; for example, run 'pytest --cov' or 'npx vitest run' in GitHub Actions or Jenkins to automate testing on every commit.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Provides a 7-step debugging protocol plus language-specific commands to systematically identify, verify, and fix software bugs across multiple environments.
A comprehensive skill for using the Cursor CLI agent for various software engineering tasks (updated for 2026 features, includes tmux automation guide).
Control and operate Opencode via slash commands. Use this skill to manage sessions, select models, switch agents (plan/build), and coordinate coding through Opencode.
Coding style memory that adapts to your preferences, conventions, and patterns for consistent coding.
Claude Code integration for OpenClaw. This skill provides interfaces to: - Query Claude Code documentation from https://code.claude.com/docs - Manage subagents and coding tasks - Execute AI-assisted coding workflows - Access best practices and common workflows Use this skill when users want to: - Get help with coding tasks - Query Claude Code documentation - Manage AI-assisted development workflows - Execute complex programming tasks