-
Notifications
You must be signed in to change notification settings - Fork 84
/
jest.config.js
41 lines (41 loc) · 1.21 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testMatch: ['**/?(*.)+(spec|test).[t]s?(x)'],
modulePaths: ['<rootDir>', '<rootDir>/serverless/virus-scanner/'],
moduleDirectories: [
'node_modules',
'./serverless/virus-scanner/node_modules',
],
testEnvironment: 'node',
globalSetup: '<rootDir>/__tests__/setup/jest-global-setup.js',
testPathIgnorePatterns: [
'<rootDir>/__tests__/e2e',
'<rootDir>/dist/',
'<rootDir>/node_modules/',
'<rootDir>/frontend',
],
collectCoverage: true,
collectCoverageFrom: [
'./src/**/*.{ts,js}',
'./serverless/**/*.{ts,js}',
'!**/__tests__/**',
],
coveragePathIgnorePatterns: ['./node_modules/', './tests'],
coverageReporters: ['lcov', 'text'],
coverageThreshold: {
global: {
statements: 38, // Increase this percentage as test coverage improves
},
},
testTimeout: 300000, // Set timeout to be 300s to reduce test flakiness
maxWorkers: '4',
globals: {
// Revert when memory leak in ts-jest is fixed.
// See https://github.com/kulshekhar/ts-jest/issues/1967.
'ts-jest': {
isolatedModules: true,
},
},
setupFilesAfterEnv: ['<rootDir>/__tests__/setup/jest-setupAfterEnv.js'],
}