- Added comprehensive model configuration and selection mechanism - Implemented dynamic model handling for OpenAI and DeepSeek providers - Enhanced error handling and retry logic for API interactions - Expanded system analysis with more detailed XML-based response parsing - Updated configuration loading with improved model selection and validation - Added colored logging and more informative console output - Integrated new test suite for API endpoints
59 lines
1.7 KiB
JavaScript
59 lines
1.7 KiB
JavaScript
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
module.exports = {
|
|
preset: 'ts-jest/presets/default-esm',
|
|
testEnvironment: 'node',
|
|
extensionsToTreatAsEsm: ['.ts', '.mts'],
|
|
moduleNameMapper: {
|
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
'^(\\.{1,2}/.*)\\.ts$': '$1',
|
|
'^chalk$': '<rootDir>/node_modules/chalk/source/index.js',
|
|
'#ansi-styles': '<rootDir>/node_modules/ansi-styles/index.js',
|
|
'#supports-color': '<rootDir>/node_modules/supports-color/index.js'
|
|
},
|
|
transform: {
|
|
'^.+\\.(ts|mts|js|mjs)$': [
|
|
'ts-jest',
|
|
{
|
|
useESM: true,
|
|
tsconfig: 'tsconfig.json'
|
|
},
|
|
],
|
|
},
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(@digital-alchemy|chalk|ansi-styles|supports-color)/.*)(?!.*\\.mjs$)'
|
|
],
|
|
resolver: '<rootDir>/jest-resolver.cjs',
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
testMatch: [
|
|
'**/__tests__/helpers.test.ts',
|
|
'**/__tests__/schemas/devices.test.ts',
|
|
'**/__tests__/context/index.test.ts',
|
|
'**/__tests__/hass/index.test.ts',
|
|
'**/__tests__/api/index.test.ts'
|
|
],
|
|
globals: {
|
|
'ts-jest': {
|
|
useESM: true,
|
|
},
|
|
},
|
|
collectCoverage: true,
|
|
coverageDirectory: 'coverage',
|
|
coverageReporters: ['text', 'lcov', 'clover', 'html'],
|
|
collectCoverageFrom: [
|
|
'src/**/*.ts',
|
|
'!src/**/*.d.ts',
|
|
'!src/**/*.test.ts',
|
|
'!src/types/**/*',
|
|
'!src/polyfills.ts'
|
|
],
|
|
coverageThreshold: {
|
|
global: {
|
|
branches: 50,
|
|
functions: 50,
|
|
lines: 50,
|
|
statements: 50
|
|
}
|
|
},
|
|
verbose: true,
|
|
testTimeout: 30000
|
|
};
|