Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/pramoddutta/qaskills/javascript-testing-patternsnpx skills add PramodDutta/qaskills --skill javascript-testing-patternsgit clone --depth 1 https://github.com/PramodDutta/qaskillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/pramoddutta/qaskills/javascript-testing-patterns)<a href="https://agentmods.dev/skills/pramoddutta/qaskills/javascript-testing-patterns"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/javascript-testing-patterns.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00036 | $0.04436 |
| Opus 5 | $0.00018 | $0.02218 |
| Sonnet 5 | $0.00007 | $0.00887 |
| Haiku 4.5 | $0.00004 | $0.00444 |
Grade A, and why
JavaScript Testing Patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
axios.js How it starts
The opening of the file, as written. The whole thing — 682 lines — stays where its author put it; the contents beside it link to each section on GitHub.
JavaScript Testing Patterns Skill
You are an expert JavaScript developer specializing in testing patterns and methodologies. When the user asks you to write, review, or improve JavaScript tests, follow these detailed instructions.
Core Principles
- Test behavior, not implementation -- Tests should verify what code does, not how it works internally.
- Fast feedback loops -- Unit tests should run in milliseconds.
- Arrange-Act-Assert -- Clear three-phase structure for every test.
- Deterministic tests -- Same input always produces same output.
- Isolated tests -- No shared state or dependencies between tests.
Project Structure
project/
src/
services/
user.service.js
user.service.test.js
utils/
validators.js
validators.test.js
components/
Button.jsx
Button.test.jsx
__tests__/
integration/
api.test.js
e2e/
checkout.test.js
__mocks__/
axios.js
localStorage.js
jest.config.js
Jest Configuration
// jest.config.js
module.exports = {
testEnvironment: 'jsdom',
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.js', '**/?(*.)+(spec|test).js'],
collectCoverageFrom: [
'src/**/*.{js,jsx}',
'!src/**/*.test.{js,jsx}',
'!src/**/index.js',
],
coverageThresholds: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
clearMocks: true,
restoreMocks: true,
};
Basic Testing Patterns
1. Testing Pure Functions
// validators.js
export function isValidEmail(email) {
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return regex.test(email);
}
export function calculateTotal(items) {
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
}
export function formatCurrency(amount, currency = 'USD') {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency,
}).format(amount);
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 682 lines · 36 tokens per session scan A 8761fa7aafe7
JavaScript Testing Patterns is a skill published in the GitHub repository PramodDutta/qaskills (214 stars, last pushed 5d ago), licensed MIT. It adds 36 tokens to every session and 4,436 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
test-unit-generator
Activate when writing, generating, or refactoring unit test suites in TypeScript, JavaScript, or Python using Vitest, Jest, or Pytest — trigger phrasings include "write unit tests for this function", "create a Vitest test suite", "test edge cases for this utility", "mock this API in Jest", "increase test coverage to…
testing-anti-patterns
Never test mock behavior. Never add test-only methods to production classes. Understand dependencies before mocking. Language-agnostic principles with TypeScript/Jest and Python/pytest examples.
Unit Test Improver
Reviews existing unit tests for gaps, weak assertions, and missing edge cases, then rewrites them to be more robust.
Unit Test Writer
Generates comprehensive unit tests for any function or module with edge cases.
unit-test-writer
Write comprehensive unit tests that verify behavior, catch regressions, and document intent. Covers test organization, assertions, mocking, and coverage.
Jest Unit Test
Write unit tests with Jest including mocking, assertions, and test organization.