aios-core
Version:
Synkra AIOS: AI-Orchestrated System for Full Stack Development - Core Framework
90 lines (73 loc) • 1.75 kB
JavaScript
/**
* Jest configuration for service testing.
* @type {import('jest').Config}
*/
module.exports = {
// Use ts-jest for TypeScript support
preset: 'ts-jest',
// Test environment
testEnvironment: 'node',
// Root directories for tests
roots: ['<rootDir>'],
// Test file patterns
testMatch: [
'**/__tests__/**/*.test.ts',
'**/__tests__/**/*.spec.ts',
],
// TypeScript transformation
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: {
module: 'ESNext',
moduleResolution: 'NodeNext',
},
},
],
},
// Module file extensions
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
// Coverage configuration
collectCoverageFrom: [
'**/*.ts',
'!**/*.d.ts',
'!**/__tests__/**',
'!**/node_modules/**',
'!**/dist/**',
],
// Coverage thresholds (targeting >70%)
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 70,
statements: 70,
},
},
// Coverage reporters
coverageReporters: ['text', 'text-summary', 'lcov', 'html'],
// Coverage output directory
coverageDirectory: 'coverage',
// Clear mocks between tests
clearMocks: true,
// Verbose output
verbose: true,
// Test timeout (30 seconds)
testTimeout: 30000,
// Setup files
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
// Module name mapper for path aliases
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
// Ignore patterns
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
],
// Global setup/teardown
// globalSetup: '<rootDir>/jest.global-setup.ts',
// globalTeardown: '<rootDir>/jest.global-teardown.ts',
};