feat: update Linear issue tracking with project query and workflow state handling
This commit is contained in:
+15
-40
@@ -39,10 +39,11 @@ jest.mock('mongodb', () => ({
|
||||
process.env.MONGODB_URI = 'mongodb://localhost:27017/test'
|
||||
process.env.MONGODB_DB = 'test'
|
||||
|
||||
// Mock Winston logger - simplified for default export
|
||||
// Mock Winston logger - will be overridden by individual test files if needed
|
||||
jest.mock('winston', () => ({
|
||||
transports: {
|
||||
Console: jest.fn(),
|
||||
Console: jest.fn().mockImplementation(() => ({ name: 'console' })),
|
||||
File: jest.fn().mockImplementation(() => ({ name: 'file' }))
|
||||
},
|
||||
createLogger: jest.fn(() => ({
|
||||
info: jest.fn(),
|
||||
@@ -63,47 +64,21 @@ jest.mock('winston', () => ({
|
||||
levels: { error: 0, warn: 1, info: 2, debug: 3 }
|
||||
})),
|
||||
format: {
|
||||
timestamp: jest.fn(() => ({})),
|
||||
errors: jest.fn(() => ({})),
|
||||
json: jest.fn(() => ({})),
|
||||
colorize: jest.fn(() => ({})),
|
||||
simple: jest.fn(() => ({})),
|
||||
combine: jest.fn((...args) => args[args.length - 1] || {}),
|
||||
printf: jest.fn(() => ({}))
|
||||
timestamp: jest.fn().mockReturnValue('timestamp-format'),
|
||||
errors: jest.fn().mockReturnValue('errors-format'),
|
||||
json: jest.fn().mockReturnValue('json-format'),
|
||||
colorize: jest.fn().mockReturnValue('colorize-format'),
|
||||
simple: jest.fn().mockReturnValue('simple-format'),
|
||||
combine: jest.fn().mockReturnValue('combined-format'),
|
||||
printf: jest.fn().mockReturnValue('printf-format')
|
||||
}
|
||||
}))
|
||||
|
||||
// Mock logger module to use the mocked winston
|
||||
jest.mock('./src/lib/logger', () => {
|
||||
const mockLogger = {
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
log: jest.fn(),
|
||||
child: jest.fn(() => ({
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
log: jest.fn()
|
||||
}))
|
||||
}
|
||||
|
||||
return {
|
||||
__esModule: true,
|
||||
default: mockLogger,
|
||||
logger: mockLogger,
|
||||
createComponentLogger: jest.fn(() => mockLogger.child()),
|
||||
requestLogger: mockLogger.child(),
|
||||
apiLogger: mockLogger.child(),
|
||||
dbLogger: mockLogger.child(),
|
||||
authLogger: mockLogger.child(),
|
||||
errorLogger: mockLogger.child(),
|
||||
generateRequestId: jest.fn(() => 'test-request-id'),
|
||||
withTiming: jest.fn(async (operation, fn) => fn())
|
||||
}
|
||||
})
|
||||
// Mock winston-loki
|
||||
jest.mock('winston-loki', () => jest.fn().mockImplementation(() => ({ name: 'loki' })))
|
||||
|
||||
// Let individual test files handle their own logger mocks
|
||||
// This allows for more specific testing of the logger module itself
|
||||
|
||||
// Mock Next.js Response objects
|
||||
global.Response = class Response {
|
||||
|
||||
Reference in New Issue
Block a user