Install
$ agentstack add skill-pledgeandgrow-pledge-skills-jest ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Jest Skill
> Jest — A delightful JavaScript testing framework with a focus on simplicity. > Version: Jest 30.x | Docs: jestjs.io
Quick Reference
| Topic | File | Sections | |-------|------|----------| | Getting Started & Core Concepts | getting-started.md | Installation, first test, CLI usage, configuration (Babel, TypeScript, bundlers, ESLint), matchers, async testing, setup/teardown, mock functions | | API Reference | api.md | Globals (test, describe, before/after hooks, .each, .concurrent, .failing, .todo), expect matchers, jest object (mock modules, mock functions, fake timers, misc), mock function API, CLI options, configuration options | | Guides & Advanced | guides.md | Snapshot testing, timer mocks, manual mocks, ECMAScript modules, webpack integration, watch plugins, migration guide, testing frameworks (React/Vue/Angular/Express/Next.js), Puppeteer, MongoDB, DynamoDB, architecture |
Core Concepts
- Test Runner: Jest runs tests in parallel with isolated environments for speed and reliability
- Assertions: Use
expect()with matchers liketoBe(),toEqual(),toContain(),toThrow() - Mock Functions:
jest.fn()creates mock functions to test code links, capture calls, and configure return values - Mock Modules:
jest.mock()replaces module dependencies with mocks for isolated testing - Snapshot Testing: Captures serialized output and compares against a reference snapshot file
- Fake Timers:
jest.useFakeTimers()replaces native timer functions for controlled time advancement - Code Coverage: Built-in coverage reporting via
--coverageflag with Istanbul/V8 providers - Watch Mode:
--watchre-runs only tests related to changed files for fast development feedback - Configuration:
jest.config.js,package.json"jest" key, or CLI flags; supports projects, transforms, moduleNameMapper - Test Environment:
node(default) orjsdom(browser simulation) or custom environments - Parallel Execution: Worker threads/processes with
--maxWorkersfor optimized CI performance
Jest Ecosystem
| Library | Description | |---------|-------------| | @jest/globals | Explicit imports for Jest globals (describe, expect, test) | | babel-jest | Babel integration for transpiling test files | | ts-jest | TypeScript preprocessor with source map support | | @testing-library/react | React testing utilities with Jest | | jest-puppeteer | Jest preset for E2E testing with Puppeteer | | jest-environment-jsdom | Browser-like DOM environment for Jest | | eslint-plugin-jest | ESLint plugin with Jest-specific rules | | identity-obj-proxy | Mock CSS modules in Jest | | Vitest | Vite-native alternative with Jest-compatible API |
Common Patterns
// Basic test
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
// Grouping with describe
describe('User service', () => {
beforeEach(() => setupDatabase());
test('creates user', async () => {
const user = await createUser({ name: 'Alice' });
expect(user).toHaveProperty('id');
expect(user.name).toBe('Alice');
});
});
// Mocking modules
jest.mock('axios');
test('fetches data', async () => {
axios.get.mockResolvedValue({ data: { name: 'Bob' } });
const result = await fetchData();
expect(result.name).toBe('Bob');
});
// Snapshot testing
it('renders correctly', () => {
const { container } = render(Link);
expect(container.firstChild).toMatchSnapshot();
});
Sources
- Official Jest documentation: https://jestjs.io/docs/getting-started
- Jest API reference: https://jestjs.io/docs/api
- Jest configuration: https://jestjs.io/docs/configuration
- Jest CLI options: https://jestjs.io/docs/cli
- Jest GitHub: https://github.com/jestjs/jest
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: pledgeandgrow
- Source: pledgeandgrow/pledge-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.