npm-api-analyzer
Version:
CLI tool to analyze npm packages for network API usage, prototype pollution, and security vulnerabilities
67 lines (60 loc) • 1.3 kB
JavaScript
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/__tests__'],
testMatch: [
'**/__tests__/**/*.test.(ts|js)',
'**/*.test.(ts|js)'
],
transform: {
'^.+\\.ts$': 'ts-jest'
},
collectCoverageFrom: [
'src/**/*.{ts,js}',
'!src/**/*.d.ts',
'!src/index.ts'
],
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'text-summary',
'lcov',
'html',
'json'
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
},
testTimeout: 10000,
verbose: true,
setupFilesAfterEnv: [],
moduleFileExtensions: ['ts', 'js', 'json'],
// Test grouping and reporting
displayName: 'NPM Security Analyzer Tests',
// Performance settings
maxWorkers: '50%',
// Error handling
errorOnDeprecated: true,
// Custom matchers and utilities
setupFiles: [],
// Mock settings
clearMocks: true,
restoreMocks: true,
// Watch mode settings
watchman: true,
// Reporter settings
reporters: [
'default',
['jest-junit', {
outputDirectory: 'test-results',
outputName: 'junit.xml',
suiteName: 'NPM Security Analyzer Tests'
}]
]
};