test-guide
SolidTesting patterns for claude-code-discord-bridge — pytest, async testing, mocking Discord objects, TDD workflow
Testing & QA 55 stars
28 forks Updated today MIT
Install
Quality Score: 85/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Test Guide — Testing Patterns for claude-code-discord-bridge
## When to Activate
- Writing tests for new features
- Fixing test failures
- Adding test coverage for existing code
- When asked to "add tests", "test this", or "improve coverage"
## TDD Workflow
Follow the Red-Green-Refactor cycle:
1. **RED**: Write a failing test that describes the desired behavior
2. **GREEN**: Write the minimum code to make the test pass
3. **REFACTOR**: Clean up while keeping tests green
## Project Test Setup
```toml
# pyproject.toml
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
```
- **pytest-asyncio**: Auto mode — all async test functions run automatically
- **pytest-cov**: Coverage reporting
- **No test markers needed**: asyncio_mode = "auto" handles async tests
## Test Patterns by Module
### Pure Logic (parser, chunker, types) — Full Unit Tests
These have no external dependencies. Test exhaustively:
```python
def test_parse_system_message():
line = '{"type":"system","session_id":"abc-123"}'
event = parse_line(line)
assert event.message_type == MessageType.SYSTEM
assert event.session_id == "abc-123"
def test_parse_invalid_json():
event = parse_line("not json")
assert event is None
```
### Repository (database) — Integration Tests with Real SQLite
```python
@pytest.fixture
async def repo(tmp_path):
db_path = str(tmp_path / "test.db")
await init_db(db_path)
return SessionRepository(db_path)
async def test_save_and_g...
Details
- Author
- ebibibi
- Repository
- ebibibi/ebi-agent-chat-relay
- Created
- 6 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Testing & QA Solid
tdd
Enforce test-driven development — write tests FIRST, then implement. Mandatory for new features and bug fixes.
55 Updated today
ebibibi AI & Automation Solid
python-quality
Python coding patterns, idioms, and quality standards for claude-code-discord-bridge development
55 Updated today
ebibibi Testing & QA Listed
python-testing
Python testing patterns with pytest including unit tests, integration tests, fixtures, mocking, and coverage. Use when writing Python tests.
6 Updated today
DmitriyYukhanov