query-2jz
Version:
Query-2jz: A GraphQL alternative with faster performance and simpler use
48 lines (43 loc) • 925 B
text/typescript
// Jest setup file
import { jest } from '@jest/globals';
// Mock console methods to reduce noise in tests
global.console = {
...console,
// Uncomment to ignore a specific log level
// log: jest.fn(),
// debug: jest.fn(),
// info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
};
// Set test timeout
jest.setTimeout(10000);
// Global test utilities
global.testUtils = {
createMockConfig: () => ({
database: {
type: 'sqlite',
connection: ':memory:',
},
cache: {
type: 'memory',
ttl: 300,
},
realtime: {
enabled: false,
transport: 'websocket',
},
edge: {
enabled: false,
},
models: [],
}),
createMockModel: (name: string) => ({
name,
fields: {
id: { type: 'id' },
name: { type: 'string', required: true },
createdAt: { type: 'date' },
},
}),
};