comeonoliver/skillshub/jest
Claude Code and agent skill by comeonoliver/skillshub
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install comeonoliver/skillshub/jestSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as comeonoliver/skillshub/jest.
Jest — JavaScript Testing Framework
Jest brings a batteries-included approach to JavaScript testing. Where other frameworks require you to assemble a test runner, assertion library, and mocking tool separately, Jest ships all three in a single package. You install it, write a test, and run it. That simplicity is why it dominates the JavaScript testing landscape.
This skill walks you through Jest from first principles — writing assertions, mocking dependencies, testing asynchronous code, generating coverage reports, and integrating everything into a CI pipeline.
Installing and Configuring Jest
Every Jest setup begins with installation and a configuration file. Jest works out of the box for plain JavaScript, but most real projects need a bit of configuration for TypeScript, JSX, or module resolution.
Once installed, create a configuration file at the root of your project. The jest.config.ts format gives you type checking on your configuration options.
Add test scripts to your package.json so your team has consistent commands.
Writing Assertions
Jest's expect API gives you a fluent interface for asserting values. Every test follows the same pattern: arrange your data, act on it, then assert the result.
Mock Functions and Module Mocking
Mocking is where Jest truly shines. You can replace any function, module, or timer with a controllable substitute. This lets you test units in complete isolation.
For more granular control, jest.fn() creates standalone mock functions you can pass as callbacks or method implementations.
Testing Asynchronous Code
Modern JavaScript is heavily asynchronous. Jest handles promises, async/await, and callbacks with equal ease. The key is always returning or awaiting the asynchronous operation so Jest knows when the test is done.
Snapshot Testing
Snapshots capture the output of a component or function and compare it against a saved reference. They are invaluable for catching unintended changes in UI components or serialized data structures.
When a snapshot test fails because you intentionally changed the output, update the snapshots with jest --updateSnapshot.
Coverage Reports and Watch Mode
Jest's built-in coverage tool uses Istanbul under the hood. It generates reports showing which lines, branches, functions, and statements your tests exercise.
Watch mode is where Jest becomes a development companion. It watches for file changes and re-runs only the tests affected by those changes.
Watch mode supports interactive filtering. Press p to filter tests by a filename regex, t to filter by test name, or a to run all tests. This tight feedback loop makes TDD practical even in large codebases.
CI Integration
In continuous integration, Jest should run with specific flags that optimize for non-interactive environments and produce machine-readable output.
The --ci flag changes snapshot behavior to fail instead of writing new snapshots, preventing accidental snapshot updates in CI. The --maxWorkers flag controls parallelism to match your CI runner's CPU count and avoid out-of-memory failures.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/TerminalSkills/skills/jest/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/comeonoliver/skillshub/jest)