created lots of tests
This commit is contained in:
parent
42baadae38
commit
54f37f9521
21 changed files with 4577 additions and 215 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { beforeEach, describe, expect, it } from 'bun:test';
|
||||
import { Logger, getLogger, shutdownLoggers, setLoggerConfig } from '../src/logger';
|
||||
import { Logger, getLogger, setLoggerConfig, shutdownLoggers } from '../src/logger';
|
||||
|
||||
describe('Logger', () => {
|
||||
beforeEach(async () => {
|
||||
|
|
@ -71,9 +71,7 @@ describe('Logger', () => {
|
|||
|
||||
it('should set logger config', () => {
|
||||
setLoggerConfig({
|
||||
level: 'debug',
|
||||
pretty: true,
|
||||
redact: ['password'],
|
||||
logLevel: 'debug',
|
||||
});
|
||||
|
||||
const logger = getLogger('test');
|
||||
|
|
@ -83,7 +81,7 @@ describe('Logger', () => {
|
|||
it('should handle shutdown', async () => {
|
||||
await shutdownLoggers(); // Reset first
|
||||
const logger1 = getLogger('test1');
|
||||
const logger2 = getLogger('test2');
|
||||
const _logger2 = getLogger('test2'); // not used, just to ensure multiple loggers can be created
|
||||
|
||||
// Store references
|
||||
const logger1Ref = logger1;
|
||||
|
|
@ -97,7 +95,7 @@ describe('Logger', () => {
|
|||
|
||||
it('should handle log levels', async () => {
|
||||
await shutdownLoggers(); // Reset first
|
||||
setLoggerConfig({ level: 'warn' });
|
||||
setLoggerConfig({ logLevel: 'warn' });
|
||||
const logger = getLogger('test');
|
||||
|
||||
// Just verify that log methods exist and don't throw
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue