JavaScript testing skill for test infrastructure, async test patterns, and runtime reliability using Jest, Vitest, or Mocha. Trigger phrases: JavaScript tests, Jest setup, async tests, test timeouts, flaky tests, test fixtures, mock functions.
Use this SKILL when setting up or validating test infrastructure for JavaScript/TypeScript projects, diagnosing flaky async tests, or designing reliable CI test suites.
Recommended runners:
Checklist
Templates & Examples
Example test file (Jest):
// __tests__/sum.test.js
const sum = require('../sum')
test('adds numbers', () => {
expect(sum(1,2)).toBe(3)
})
Flaky-test triage CSV header:
File,TestName,ObservedBehavior,SuggestedFix tests/api.test.js,"handles slow response","timeout in CI","increase timeout; mock network; make deterministic"
Output requirements