45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
/** @type {import('jest').Config} */
|
|
const config = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'node',
|
|
roots: ['<rootDir>/src', '<rootDir>/tests'],
|
|
testMatch: [
|
|
'**/__tests__/**/*.test.ts',
|
|
'**/?(*.)+(spec|test).ts'
|
|
],
|
|
transform: {
|
|
'^.+\\.ts$': ['ts-jest', {
|
|
tsconfig: {
|
|
module: 'commonjs',
|
|
esModuleInterop: true,
|
|
allowSyntheticDefaultImports: true
|
|
}
|
|
}]
|
|
},
|
|
collectCoverageFrom: [
|
|
'src/lib/**/*.ts',
|
|
'server.ts',
|
|
'!src/**/*.d.ts',
|
|
'!src/main.tsx',
|
|
'!src/App.tsx',
|
|
'!src/components/**/*.tsx'
|
|
],
|
|
coverageDirectory: 'coverage',
|
|
coverageReporters: ['text', 'lcov', 'html'],
|
|
coverageThreshold: {
|
|
global: {
|
|
branches: 75,
|
|
functions: 80,
|
|
lines: 80,
|
|
statements: 80
|
|
}
|
|
},
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
|
testTimeout: 15000,
|
|
verbose: true,
|
|
modulePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/server-dist/'],
|
|
clearMocks: true,
|
|
restoreMocks: true
|
|
};
|
|
|
|
module.exports = config; |