Jest
Skill a5c-ai/babysitter/library/specializations/web-development/skills/jest
Jest configuration, mocking strategies, snapshot testing, and coverage.From its SKILL.md
npx -y skills add a5c-ai/babysitter --skill jestAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.3 KB, 191 tokens by cl100k_base, as published. Nobody here has run it
Jest Skill
Expert assistance for testing with Jest.
Capabilities
- Configure Jest for various frameworks
- Implement mocking strategies
- Write snapshot tests
- Configure coverage
- Handle async testing
Test Patterns
describe('UserService', () => {
let service: UserService;
let mockRepository: jest.Mocked<UserRepository>;
beforeEach(() => {
mockRepository = {
findAll: jest.fn(),
findById: jest.fn(),
create: jest.fn(),
};
service = new UserService(mockRepository);
});
it('should return all users', async () => {
mockRepository.findAll.mockResolvedValue([{ id: '1', name: 'John' }]);
const result = await service.findAll();
expect(result).toHaveLength(1);
expect(mockRepository.findAll).toHaveBeenCalled();
});
});
Target Processes
- unit-testing
- integration-testing
- tdd-development
What ships with it: 1 file
330 B alongside SKILL.md
- README.md330 B