JavaScript Testing Patterns
Comprehensive guide for implementing robust testing strategies in JavaScript/TypeScript applications using modern testing frameworks and best practices.
Use this skill when
- 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
Do not use this skill when
- The task is unrelated to javascript testing patterns
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
Resources
resources/implementation-playbook.mdfor detailed patterns and examples.
AGI Framework Integration
Adapted for @techwavedev/agi-agent-kit Original source: antigravity-awesome-skills
Memory-First Protocol
Retrieve prior test strategies, known flaky tests, and coverage gaps. Cache test infrastructure setup to avoid re-configuring test environments.
# Check for prior testing/QA context before starting
python3 execution/memory_manager.py auto --query "test patterns and coverage strategies for Javascript Testing Patterns"
Storing Results
After completing work, store testing/QA decisions for future sessions:
python3 execution/memory_manager.py store \
--content "Testing strategy: integration tests hit real DB (no mocks), 85% line coverage, mutation testing on critical paths" \
--type technical --project <project> \
--tags javascript-testing-patterns testing
Multi-Agent Collaboration
Share test results and coverage reports with code review agents so they can verify adequate coverage on changed code.
python3 execution/cross_agent_context.py store \
--agent "<your-agent>" \
--action "QA complete — test suite expanded with 12 new integration tests, all passing" \
--project <project>
TDD Enforcement
This skill integrates with the framework's iron-law RED-GREEN-REFACTOR cycle. No production code without a failing test first.
Agent Team: QA
Dispatch qa_team to generate tests and verify they pass before marking implementation complete.