fixed logger tests

This commit is contained in:
Bojan Kucera 2025-06-07 12:22:45 -04:00
parent d836e766d5
commit 38b523d2c0
4 changed files with 21 additions and 19 deletions

View file

@ -5,7 +5,7 @@
* Provides utilities and mocks for testing logging operations.
*/
import { Logger, LogMetadata } from '../src';
import { Logger, LogMetadata, shutdownLoggers } from '../src';
import { afterAll, afterEach, beforeAll, beforeEach } from 'bun:test';
// Store original console methods
@ -178,8 +178,9 @@ beforeAll(() => {
});
// Clean up after each test
afterEach(() => {
// loggerTestHelpers.clearCapturedLogs(); // REMOVE this if it targeted a global array
afterEach(async () => {
// Clear logger cache to prevent state pollution between tests
await shutdownLoggers();
});
// Restore everything after tests