test-guide

Solid

Testing patterns for claude-code-discord-bridge — pytest, async testing, mocking Discord objects, TDD workflow

Testing & QA 55 stars 28 forks Updated today MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
58
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

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