Jest testing best practices for JavaScript and TypeScript projects with mocking, async handling, and React patterns.
Works with
Organize tests with descriptive names in nested describe blocks, using .test.ts / .test.js files placed alongside source code or in __tests__ directories
Mock external dependencies with jest.mock() , jest.spyOn() , and mockImplementation() , resetting between tests to prevent state leakage
Handle async code with promises, async/await , and resolves / rejects matchers;
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionjavascript-typescript-jestExecute the skills CLI command in your project's root directory to begin installation:
Fetches javascript-typescript-jest from github/awesome-copilot and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate javascript-typescript-jest. Access via /javascript-typescript-jest in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
2
total installs
2
this week
28.7K
GitHub stars
0
upvotes
Run in your terminal
2
installs
2
this week
28.7K
stars
.test.ts or .test.js suffix__tests__ directorydescribe('Component/Function/Class', () => { it('should do something', () => {}) })jest.mock() for module-level mocksjest.spyOn() for specific function mocksmockImplementation() or mockReturnValue() to define mock behaviorjest.resetAllMocks() in afterEachresolves/rejects matchers for promisesjest.setTimeout()userEvent over fireEvent for more realistic user interactionsexpect(value).toBe(expected), expect(value).toEqual(expected)expect(value).toBeTruthy(), expect(value).toBeFalsy()expect(value).toBeGreaterThan(3), expect(value).toBeLessThanOrEqual(3)expect(value).toMatch(/pattern/), expect(value).toContain('substring')expect(array).toContain(item), expect(array).toHaveLength(3)expect(object).toHaveProperty('key', value)expect(fn).toThrow(), expect(fn).toThrow(Error)expect(mockFn).toHaveBeenCalled(), expect(mockFn).toHaveBeenCalledWith(arg1, arg2)Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
github/awesome-copilot
github/awesome-copilot
github/awesome-copilot
github/awesome-copilot
jwynia/agent-skills
dotneet/claude-code-marketplace
I recommend javascript-typescript-jest for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Keeps context tight: javascript-typescript-jest is the kind of skill you can hand to a new teammate without a long onboarding doc.
javascript-typescript-jest fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
We added javascript-typescript-jest from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
javascript-typescript-jest has been reliable in day-to-day use. Documentation quality is above average for community skills.
Useful defaults in javascript-typescript-jest — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Useful defaults in javascript-typescript-jest — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
We added javascript-typescript-jest from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
I recommend javascript-typescript-jest for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
javascript-typescript-jest fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
showing 1-10 of 75