Jeden Skill in Manus ausführen
mit einem Klick
mit einem Klick
Jeden Skill in Manus mit einem Klick ausführen
Loslegen$pwd:
$ git log --oneline --stat
stars:0
forks:0
updated:11. Februar 2026 um 00:48
SKILL.md
| name | Generate Tests |
| description | Generate comprehensive test suites for code |
This skill helps generate comprehensive tests following project conventions.
Use this skill when:
Python: pytest, unittest JavaScript/TypeScript: Jest, Vitest, Mocha Java: JUnit 5, TestNG Go: testing package
# Python example
import pytest
from module import function
class TestFunction:
"""Test suite for function."""
@pytest.fixture
def setup_data(self):
"""Create test data."""
return {"key": "value"}
def test_happy_path(self, setup_data):
"""Test normal operation."""
result = function(setup_data)
assert result == expected
def test_edge_case(self):
"""Test edge case."""
result = function(edge_input)
assert result == edge_expected
def test_error_condition(self):
"""Test error handling."""
with pytest.raises(ValueError):
function(invalid_input)
Unit Tests: Test individual functions/methods in isolation
Integration Tests: Test component interactions
Edge Cases:
Error Conditions:
test_method_scenario_expected// TypeScript with Jest
describe('UserService', () => {
let service: UserService;
let mockRepository: jest.Mocked<UserRepository>;
beforeEach(() => {
mockRepository = {
findById: jest.fn(),
save: jest.fn()
} as any;
service = new UserService(mockRepository);
});
describe('getUserById', () => {
it('should return user when found', async () => {
const mockUser = { id: '1', name: 'Test' };
mockRepository.findById.mockResolvedValue(mockUser);
const result = await service.getUserById('1');
expect(result).toEqual(mockUser);
expect(mockRepository.findById).toHaveBeenCalledWith('1');
});
it('should throw error when not found', async () => {
mockRepository.findById.mockResolvedValue(null);
await expect(service.getUserById('999'))
.rejects
.toThrow('User not found');
});
});
});
# Python with pytest
def test_get_user_endpoint(client, test_db):
"""Test GET /users/:id endpoint."""
# Arrange
user = create_test_user(test_db)
# Act
response = client.get(f'/users/{user.id}')
# Assert
assert response.status_code == 200
assert response.json()['id'] == user.id
assert response.json()['email'] == user.email
def test_get_user_not_found(client):
"""Test GET /users/:id with invalid ID."""
response = client.get('/users/999')
assert response.status_code == 404
assert 'error' in response.json()
@pytest.fixture
def sample_user():
"""Create sample user for testing."""
return User(
id=1,
email="test@example.com",
name="Test User"
)
@pytest.fixture
def user_factory():
"""Factory for creating test users."""
def _create(email=None, name=None):
return User(
email=email or f"test{uuid.uuid4()}@example.com",
name=name or "Test User"
)
return _create
@pytest.mark.parametrize("input,expected", [
("hello", "HELLO"),
("world", "WORLD"),
("", ""),
])
def test_uppercase(input, expected):
"""Test uppercase function with various inputs."""
assert uppercase(input) == expected
Always check and follow: