Skip to main content

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)​

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:

  1. Example 28: Vitest Testing - Learn zero boilerplate testing
  2. Example 29: Jest Testing - Apply the same patterns with Jest
  3. Example 30: Redis Context - Test Redis operations without external dependencies
  4. Example 31: Serializers Testing - Test custom serialization logic
  5. 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