SyntropyLog Examples
Complete examples demonstrating SyntropyLog features and best practices.
📦 Version: This documentation corresponds to SyntropyLog v0.7.0
Testing Overview​
Testing Overview - Comprehensive guide to testing with SyntropyLog, including framework-agnostic mocks, spy function injection, and best practices.
Testing Examples​
✅ Complete & Tested (28-32)​
- Example 28: Testing patterns with Vitest - Declarative testing with Vitest and SyntropyLogMock
- Example 29: Testing patterns with Jest - Declarative testing with Jest and SyntropyLogMock
- Example 30: Testing Redis context patterns - Testing Redis context with BeaconRedisMock
- Example 31: Testing serializers - Testing custom serialization logic with MockSerializerRegistry
- Example 32: Testing transport concepts - Understanding transports as spies and testing patterns
Core Framework Examples​
✅ Complete & Tested (00-13, 20-24)​
- 00-09: Core Framework Features - Basic setup, context, configuration
- 10-13: HTTP & Redis Integration - Framework agnosticism (Express, Fastify)
- 20-24: Message Brokers - Kafka, RabbitMQ, NATS with correlation
🚧 In Development (14-19, 25-27)​
- 14-19: Advanced Framework Features - NestJS, Koa, Hapi, custom serializers
- 25-27: Enterprise Patterns - Production configuration, advanced context
Getting Started​
Start with the testing examples to understand how to write clean, declarative tests:
- Example 28: Vitest Testing - Learn zero boilerplate testing
- Example 29: Jest Testing - Apply the same patterns with Jest
- Example 30: Redis Context - Test Redis operations without external dependencies
- Example 31: Serializers Testing - Test custom serialization logic
- Example 32: Transport Concepts - Understand transports as spies
Key Principles​
- Test behavior, not implementation - Focus on what your code produces
- Use mocks for external dependencies - No Redis, brokers, or HTTP servers needed
- Keep tests simple and readable - Tests should read like specifications
- Zero boilerplate - No initialization or shutdown in tests
Related Documentation​
- Getting Started - Complete setup guide
- Configuration Guide - Configuration options
- API Reference - Full API documentation
- Production Guide - Production deployment