mirror of
https://github.com/SquidSec/SquidGate
synced 2026-08-09 12:22:48 +00:00
- Refactored into testable modules (config, prompts, llm, checks) - Comprehensive unit tests for config loading/merging/overrides, severity blocking, prompt construction (OWASP/CWE enforcement), LLM JSON extraction (noisy output handling), check run annotations, PR comments, filtering - All claims from spec validated (21 tests) - Dist bundle included for action consumption - Private repo under SquidSec for self-hosted runner support
34 lines
802 B
JavaScript
34 lines
802 B
JavaScript
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
module.exports = {
|
|
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,
|
|
"strict": true,
|
|
"types": ["jest", "node"]
|
|
}
|
|
}],
|
|
},
|
|
moduleFileExtensions: ['ts', 'js', 'json'],
|
|
collectCoverageFrom: [
|
|
'src/**/*.{ts,js}',
|
|
'!src/index.ts', // entrypoint with side effects
|
|
'!**/node_modules/**',
|
|
],
|
|
coverageThreshold: {
|
|
global: {
|
|
branches: 50,
|
|
functions: 55,
|
|
lines: 55,
|
|
statements: 55,
|
|
},
|
|
},
|
|
clearMocks: true,
|
|
resetMocks: true,
|
|
};
|