wshobson avatar

Javascript Testing Patterns

The javascript-testing-patterns skill provides developers with comprehensive guidance for implementing testing strategies in JavaScript/TypeScript applications using Jest, Vitest, and Testing Library. It addresses the problem of setting up robust test infrastructure and establishing consistent testing practices across unit tests, integration tests, and end-to-end tests through practical patterns for mocking, fixtures, and test-driven development workflows. The skill is designed for developers who need to write tests, configure test environments, or implement TDD/BDD methodologies in CI/CD pipelines.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
7
skills.sh installs
21.1K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill javascript-testing-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

JavaScript Testing Patterns

Comprehensive guide for implementing robust testing strategies in JavaScript/TypeScript applications using modern testing frameworks and best practices.

When to Use This Skill

  • Setting up test infrastructure for new projects
  • Writing unit tests for functions and classes
  • Creating integration tests for APIs and services
  • Implementing end-to-end tests for user flows
  • Mocking external dependencies and APIs
  • Testing React, Vue, or other frontend components
  • Implementing test-driven development (TDD)
  • Setting up continuous testing in CI/CD pipelines

Testing Frameworks

Jest - Full-Featured Testing Framework

Setup:

// jest.config.ts
import type { Config } from "jest";

const config: Config = {
  preset: "ts-jest",
  testEnvironment: "node",
  roots: ["<rootDir>/src"],
  testMatch: ["**/__tests__/**/*.ts", "**/?(*.)+(spec|test).ts"],
  collectCoverageFrom: [
    "src/**/*.ts",
    "!src/**/*.d.ts",
    "!src/**/*.interface.ts",
  ],
  coverageThreshold: {
    global: {
      branches: 80,
      functions: 80,
      lines: 80,
      statements: 80,
    },
  },
  setupFilesAfterEnv: ["<rootDir>/src/test/setup.ts"],
};

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
Testing & QA, Documentation, Cloud & Infrastructure

More from wshobson/agents

All 174
1dart-lang avatardart-generate-test-mocksdart-lang/skillsDefine and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex exte19.4Kskills.sh installs
2antfu avatarvue-testing-best-practicesantfu/skillsUse for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.17.2Kskills.sh installs
3vuejs-ai avatarvue-testing-best-practicesvuejs-ai/skillsUse for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.14.8Kskills.sh installs
4github avatarscoutqa-testgithub/awesome-copilotThis skill should be used when the user asks to "test this website", "run exploratory testing", "check for accessibility issues", "verify the login flow works",10Kskills.sh installs
5cypress-io avatarcypress-authorcypress-io/ai-toolkitCreates, updates, and fixes Cypress tests (E2E/end-to-end and component tests). Use when the user asks to create tests, add tests, write tests, update tests, te9.5Kskills.sh installs
6cypress-io avatarcypress-explaincypress-io/ai-toolkitExplains Cypress tests (E2E and component tests), and answers questions about Cypress use and behavior. Use when the user asks to explain how a test works, expl8.5Kskills.sh installs