
javascript-typescript-jest
Jest testing best practices for JavaScript and TypeScript projects
by githubFree
Description
javascript-typescript-jest is an agent skill from the github/awesome-copilot collection that gives Jest testing best practices for JavaScript and TypeScript projects. It covers test structure, mocking, async code and common patterns, including React. Test files take a .test.ts or .test.js suffix and sit next to the code they test or in a __tests__ directory. Tests are grouped in nested describe blocks, and each test name explains the behavior it expects, in the form describe the component, then it should do something. For mocking, the skill recommends replacing external dependencies such as APIs and databases so tests stay isolated, using jest.mock for module-level mocks and jest.spyOn for individual functions, defining behavior with mockImplementation or mockReturnValue, and resetting mocks between tests so one test does not leak into the next. For async code it recommends always returning a promise or using async and await, using the resolves and rejects matchers, and setting timeouts for slow tests. It is useful for JavaScript and TypeScript teams that want a consistent test style and tests that stay reliable as the code changes. Tests that mock too much can pass while the real integration is broken, so some tests should run against real components or real services in a test environment. The skill is installed with the skills CLI from the github/awesome-copilot repository. Its skills.sh page showed about 12.8K installs and passing results from three security audits at the time of the scan.…
Highlights
- Test file naming and placement
- Nested describe blocks and clear test names
- Mocking with jest.mock and jest.spyOn
- Async testing with resolves and rejects
- Reset rules between tests
- Installs with the skills CLI
Ratings & Reviews
No ratings yet
Be the first to rate javascript-typescript-jest.
People also visit

migrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn
javascript-typescript-jest FAQ
Where should test files go?
Next to the code they test, or in a __tests__ directory, with a .test.ts or .test.js suffix.
When should I mock?
To isolate tests from external dependencies such as APIs and databases, using jest.mock or jest.spyOn.
Can mocks hide real bugs?
Yes. Some tests should also run against real components or services in a test environment.
How do I install it?
Run npx skills add https://github.com/github/awesome-copilot --skill javascript-typescript-jest.
What security audits does it have?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
What are the best javascript-typescript-jest alternatives?
Popular alternatives to javascript-typescript-jest include vitest, javascript-pro and test-master. See all javascript-typescript-jest alternatives








