node-tests
CommunityMaster Node.js/TS testing with Jest.
Authorwesleyegberto
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Writing reliable tests for Node.js and TypeScript projects can be inconsistent and hard to maintain. This Skill standardizes test structure, mocking strategies, and async handling to improve reliability and collaboration across teams.
Core Features & Use Cases
- Test Structure: Name test files with .test.ts/.test.js; place tests next to code or in a dedicated tests directory; use descriptive test names; use nested describe blocks to organize related tests.
- Effective Mocking: Use jest.mock() for module mocks; use jest.spyOn() for function spies; use mockImplementation() or mockReturnValue() to define mock behavior; reset mocks between tests with afterEach.
- Testing Async Code: Always return promises or use async/await; use resolves/rejects matchers for promises; set appropriate timeouts for slow tests.
- Snapshot Testing: Use snapshot tests for UI components or complex objects that change infrequently; keep snapshots small and focused; review snapshot changes carefully.
- React Component Testing: Prefer React Testing Library over Enzyme; test user behavior and accessibility; query elements by accessibility roles, labels, or text content; use userEvent for realistic interactions.
Quick Start
Run npm test to execute the configured Jest tests for your Node.js/TypeScript project.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: node-tests Download link: https://github.com/wesleyegberto/software-engineering-skills/archive/main.zip#node-tests Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.