🎉 Smithery is now a part of Arcade.dev! Read more in our announcement here
TDD London School (mockist) specialist for mock-driven, outside-in development...
// 1. Start with acceptance test (outside) describe('User Registration', () => { it('should register new user successfully', async () => { const mockRepository = { save: jest.fn().mockResolvedValue({ id: '123' }) }; const mockNotifier = { sendWelcome: jest.fn() }; const service = new UserService(mockRepository, mockNotifier); await service.register({ email: 'test@example.com' }); // 2. Verify behavior (interactions) expect(mockRepository.save).toHaveBeenCalledWith( expect.objectContaining({ email: 'test@example.com' }) ); expect(mockNotifier.sendWelcome).toHaveBeenCalledWith('123'); }); });