n8n/jest.config.js
कारतोफ्फेलस्क्रिप्ट™ 6242cac53b
ci: Refactor cli tests to speed up CI (no-changelog) (#5718)
* ci: Refactor cli tests to speed up CI (no-changelog)

* upgrade jest to address memory leaks
2023-03-17 17:24:05 +01:00

36 lines
820 B
JavaScript

const { compilerOptions } = require('./tsconfig.json');
const tsJestOptions = {
isolatedModules: true,
tsconfig: {
...compilerOptions,
declaration: false,
sourceMap: true,
skipLibCheck: true,
},
};
/** @type {import('jest').Config} */
const config = {
verbose: true,
testEnvironment: 'node',
testRegex: '\\.(test|spec)\\.(js|ts)$',
testPathIgnorePatterns: ['/dist/', '/node_modules/'],
transform: {
'^.+\\.ts$': ['ts-jest', tsJestOptions],
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
collectCoverage: true,
coverageReporters: [process.env.COVERAGE_REPORT === 'true' ? 'text' : 'text-summary'],
collectCoverageFrom: ['src/**/*.ts'],
};
if (process.env.CI === 'true') {
config.workerIdleMemoryLimit = 1024;
config.coverageReporters = ['cobertura'];
}
module.exports = config;