mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
0631f69d98
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <[email protected]>
38 lines
888 B
JavaScript
38 lines
888 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',
|
|
},
|
|
setupFilesAfterEnv: ['jest-expect-message'],
|
|
collectCoverage: true,
|
|
coverageReporters: [process.env.COVERAGE_REPORT === 'true' ? 'text' : 'text-summary'],
|
|
collectCoverageFrom: ['src/**/*.ts'],
|
|
testTimeout: 10_000,
|
|
};
|
|
|
|
if (process.env.CI === 'true') {
|
|
config.workerIdleMemoryLimit = 1024;
|
|
config.coverageReporters = ['cobertura'];
|
|
}
|
|
|
|
module.exports = config;
|