-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestsize:SSmall: 2 points - Simple features, bug fixesSmall: 2 points - Simple features, bug fixestype:testTesting improvements and test coverageTesting improvements and test coverage
Description
Summary
Improve the error logging validation in test-logging-formats.js to ensure comprehensive verification of error log structure.
Current State
The error format test only checks for the presence of "stack" string in the output, but doesn't validate the complete error log structure as defined by the structured logger.
Missing Validations
- ✗
level: "error"verification - ✗
error_detailsobject structure validation - ✗ Proper error metadata nesting
- ✗ Error type and message validation
Implementation
// Add to test-logging-formats.js error test section
const logEntry = JSON.parse(errorOutput.trim().split('\n')[0]);
// Verify error level
expect(logEntry.level).toBe('error');
// Verify error_details structure
expect(logEntry.error_details).toBeDefined();
expect(logEntry.error_details.stack).toContain('Error');
expect(logEntry.error_details.message).toBe('Test error message');
expect(logEntry.error_details.type).toBe('Error');Acceptance Criteria
- Error logs validated for correct
level: "error" -
error_detailsobject structure verified - Stack trace content validated
- Error message and type verified
- Test provides clear failure messages for each validation
Priority
Medium - improves test robustness but doesn't block current functionality
Related
Part of structured logging test suite improvements identified in synthesis review.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestsize:SSmall: 2 points - Simple features, bug fixesSmall: 2 points - Simple features, bug fixestype:testTesting improvements and test coverageTesting improvements and test coverage