javascript-typescript-jest
Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.
npx skills add github/awesome-copilot --skill javascript-typescript-jest --agent copilot
Same command for any agent — swap --agent for claude-code, codex, cursor.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
### Test Structure - Name test files with `.test.ts` or `.test.js` suffix - Place test files next to the code they test or in a dedicated `__tests__` directory - Use descriptive test names that explain the expected behavior - Use nested describe blocks to organize related tests - Follow the pattern: `describe('Component/Function/Class', () => { it('should do something', () => {}) })` ### Effective Mocking - Mock external dependencies (APIs, databases, etc.) to isolate your tests - Use `jest.mock()` for module-level mocks - Use `jest.spyOn()` for specific function mocks - Use `mockImplementation()` or `mockReturnValue()` to define mock behavior - Reset mocks between tests with `jest.resetAllMocks()` in `afterEach` ### Testing Async Code - Always return promises or use async/await syntax in tests - Use `resolves`/`rejects` matchers for promises - Set appropriate timeouts for slow tests with `jest.setTimeout()` ### Snapshot Testing - Use snapshot tests for UI components or complex objects that change infrequently - Keep snapshots small and focused - Review snapshot changes carefully before committing ### Testing React Components - Use React Testing Library over Enzyme for testing comp
- Test Structure
- Effective Mocking
- Testing Async Code
- Snapshot Testing
- Testing React Components
- Common Jest Matchers
What does the javascript-typescript-jest skill do?
Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.
How do I install it?
Run `npx skills add github/awesome-copilot --skill javascript-typescript-jest --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From github/awesome-copilot, a repository with 37,432 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.