feat(logging-p0): complete Wave 2 - Auth/Extractor/Cleaner services transformed

This commit is contained in:
Misaka
2026-04-04 10:39:06 +08:00
parent 24d9bfebaf
commit 78a3066904
14 changed files with 3183 additions and 416 deletions

View File

@@ -0,0 +1,54 @@
/**
* Logger Integration Tests - RequestContext Integration
* Verifies RequestContext is properly integrated with Logger
*/
import { describe, it, expect } from 'vitest'
describe('Logger RequestContext Integration', () => {
it('should export run from request-context', async () => {
const { run } = await import('../../src/main/services/logger/index')
expect(run).toBeDefined()
expect(typeof run).toBe('function')
})
it('should export getRequestId from request-context', async () => {
const { getRequestId } = await import('../../src/main/services/logger/index')
expect(getRequestId).toBeDefined()
expect(typeof getRequestId).toBe('function')
})
it('should export getContext from request-context', async () => {
const { getContext } = await import('../../src/main/services/logger/index')
expect(getContext).toBeDefined()
expect(typeof getContext).toBe('function')
})
it('should export withContext from request-context', async () => {
const { withContext } = await import('../../src/main/services/logger/index')
expect(withContext).toBeDefined()
expect(typeof withContext).toBe('function')
})
it('should export withRequestContext wrapper', async () => {
const { withRequestContext } = await import('../../src/main/services/logger/index')
expect(withRequestContext).toBeDefined()
expect(typeof withRequestContext).toBe('function')
})
it('should export createLogger', async () => {
const { createLogger } = await import('../../src/main/services/logger/index')
expect(createLogger).toBeDefined()
expect(typeof createLogger).toBe('function')
})
it('should have all exports available from LoggerContext type', async () => {
const loggerModule = await import('../../src/main/services/logger/index')
expect(loggerModule.run).toBeDefined()
expect(loggerModule.getRequestId).toBeDefined()
expect(loggerModule.getContext).toBeDefined()
expect(loggerModule.withContext).toBeDefined()
expect(loggerModule.withRequestContext).toBeDefined()
expect(loggerModule.createLogger).toBeDefined()
})
})