
Javascript Typescript Jest
github/awesome-copilotOfficial
The javascript-typescript-jest skill provides best practices for writing unit tests in JavaScript and TypeScript projects using the Jest testing framework, covering test structure, mocking strategies, async testing, and React component testing. It's designed for developers building applications with Jest who need guidance on organizing tests, isolating dependencies through mocking, and using appropriate matchers and testing patterns. This skill solves the problem of writing ineffective or poorly organized tests by establishing conventions for test naming, file placement, mock management, and testing different code types.
- skills.sh installs
- 14.5K
- GitHub stars
- 41K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add github/awesome-copilot --skill javascript-typescript-jest --agent claude-codeInstalls into .claude/skills of the current project.
Files
Test Structure
- Name test files with
.test.tsor.test.jssuffix - 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()ormockReturnValue()to define mock behavior - Reset mocks between tests with
jest.resetAllMocks()inafterEach
Testing Async Code
- Always return promises or use async/await syntax in tests
- Use
resolves/rejectsmatchers 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
Sponsors
Promote your product hereReach 125k+ visitors monthlyPromote your product hereReach 125k+ visitors monthly
Agent CaffeineSponsoredClose your lid, come back to finished work
SnugSponsoredThe clipboard manager for the AI eraPromote your product hereReach 125k+ visitors monthly
WaxSponsoredBlock anything with supervision, without erasing your iPhonePromote your product hereReach 125k+ visitors monthly
knobsSponsoredSee your site on any phone, any day, in any language
Details
- Repository
- github.com/github/awesome-copilot
- Categories
- Testing & QA, Git & Pull Requests, Documentation, AI & Agent Building
More from github/awesome-copilot
All 318- Nuget Manager14.5K
- Microsoft Code Reference14.4K
- Web Design Reviewer14.3K
- Playwright Automation Fill In Form13.7K
- Create Specification13.6K
- Game Engine13.4K
- Create Agentsmd13.3K
- Refactor Plan13K
- Pytest Coverage13K
- Penpot Uiux Design12.9K
- Memory Merger12.9K
- Postgresql Code Review12.8K
- Create Implementation Plan12.6K
- Webapp Testing12.5K
- Architecture Blueprint Generator12.3K
- Typescript Mcp Server Generator12.1K
- Java Junit11.8K
- Dotnet Design Pattern Review11.7K
- Dotnet Upgrade11.7K
- Apple Appstore Reviewer11.5K
- Review And Refactor11.1K
- Update Implementation Plan11.1K
- Make Repo Contribution11.1K
- Csharp Async11.1K
Recommended
More Testing & QA1
webapp-testinggithub/awesome-copilotToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing br12.5Kskills.sh installs
2
bats-testing-patternswshobson/agentsMaster Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test11.4Kskills.sh installs
3
web3-testingwshobson/agentsTest smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, set11.2Kskills.sh installs
4
terraform-testhashicorp/agent-skillsComprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infr9.2Kskills.sh installs
5
browser-qaaffaan-m/eccUse this skill to automate visual testing and UI interaction verification using browser automation after deploying features.6Kskills.sh installs
6
cpp-testingaffaan-m/eccUse only when writing/updating/fixing C++ tests, configuring GoogleTest/CTest, diagnosing failing or flaky tests, or adding coverage/sanitizers.5.8Kskills.sh installs