testing

Run and report Jest, React Testing Library, and Playwright tests for Oak AI projects.

31|4|Updated Aug 21, 2024
One-click install
npx skills add https://github.com/oaknational/oak-ai-lesson-assistant --skill testing-oaknational
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/oaknational/oak-ai-lesson-assistant/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/oaknational/oak-ai-lesson-assistant --skill testing-oaknational

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes testing commands for Oak AI projects including unit tests with Jest, E2E tests with Playwright, and coverage reporting, saving time when debugging failures.

Core Features & Use Cases

  • All tests: pnpm test
  • Specific test pattern: pnpm test -- -t "test name pattern"
  • E2E tests: pnpm test-e2e
  • Coverage: pnpm test-coverage
  • Package-specific tests: pnpm --filter @oakai/aila test, pnpm --filter @oakai/nextjs test, pnpm --filter @oakai/api test
  • Test Framework: Jest for unit tests, React Testing Library for component tests, Playwright for E2E tests
  • Guidance: How to run tests in VSCode and across the monorepo

Frequently Asked Questions about testing

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

FAQPage Schema
How do I run tests in a monorepo with pnpm?

Run tests across your monorepo using pnpm test for all unit and component tests, or pnpm --filter @oakai/[package] test to run tests for a specific package. Jest executes unit tests, React Testing Library runs component tests, and both produce structured output you can filter by test name pattern using pnpm test -- -t "pattern".

How do I run end-to-end tests with Playwright?

Execute end-to-end tests using pnpm test-e2e, which runs Playwright tests across your Oak AI project. This produces reproducible E2E test outputs separate from unit tests and integrates with your monorepo's pnpm workflow.

Can I filter tests by name pattern?

Yes, filter Jest tests by name pattern using pnpm test -- -t "test name pattern". This targets specific tests without running your full suite, speeding up iteration during debugging.

How do I generate test coverage reports?

Generate coverage data using pnpm test-coverage, which runs Jest with coverage instrumentation and produces a structured coverage report. You can combine this with package filters like pnpm --filter @oakai/api test-coverage for package-specific coverage.

Does this work with package-specific testing in monorepos?

Yes, run tests for individual packages using pnpm --filter @oakai/aila test, pnpm --filter @oakai/nextjs test, or pnpm --filter @oakai/api test. This lets you validate changes in isolation before running the full test suite across all packages.

What test frameworks does this support?

This Skill supports Jest for unit tests, React Testing Library for component tests, and Playwright for end-to-end tests. All three frameworks integrate into pnpm commands and produce standardized, reproducible test outputs with optional coverage reporting.