observability-testing

Validate structured logging with a mock logger and assertion helpers.

5|1|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/apankov1/quality-engineering --skill observability-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-testing
Source: https://github.com/apankov1/quality-engineering/tree/main/skills/observability-testing
Command: npx skills add https://github.com/apankov1/quality-engineering --skill observability-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Structured logging is essential for debugging and observability in production. This skill provides utilities to test and enforce structured log output using a mock logger and assertion helpers.

Core Features & Use Cases

  • Mock logger capturing entries across debug, info, warn, and error levels
  • Assertion helpers like assertLogEntry, assertNoLogsAbove, assertHasLogLevel, assertErrorLogged
  • LOG_LEVEL_POLICY and classifyLogLevel to ensure consistent logging across code

Quick Start

Run the test suite for the observability-testing skill to verify log assertions.

Frequently Asked Questions about observability-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test structured logging output in TypeScript?

To test structured logging in TypeScript, you use a mock logger to capture entries and assertion helpers like assertLogEntry to verify exact output and log levels in unit and integration tests.

Can I enforce a log level policy across my JavaScript codebase?

Yes, you can enforce a log level policy using a LOG_LEVEL_POLICY reference and a classifyLogLevel helper, ensuring consistent logging practices and preventing unexpected log levels across your JavaScript or TypeScript project.

How do I assert that no warnings or errors were logged during a test?

You can assert that no warnings or errors were logged by using the assertNoLogsAbove helper, which checks the captured mock logger entries against your specified log level policy to fail the test if higher severity logs are present.

Does this observability testing approach work with existing JavaScript test suites?

Yes, this observability testing approach works with existing JavaScript and TypeScript test suites by integrating a strict structured-logger interface and mock logger, requiring only a TypeScript runtime for compatibility.

What is the best way to verify error logs in integration tests?

The best way to verify error logs in integration tests is using a mock logger to capture entries and the assertErrorLogged helper, which validates that the expected error level entries were generated during code execution.