mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-12 11:20:40 +03:00
9f83cc1426
Split from https://github.com/twentyhq/twenty/pull/4518 Part of https://github.com/twentyhq/twenty/issues/4766
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest';
|
|
|
|
import { compilerOptions } from './tsconfig.json';
|
|
|
|
const jestConfig: JestConfigWithTsJest = {
|
|
// to enable logs, comment out the following line
|
|
silent: true,
|
|
displayName: 'twenty-front',
|
|
preset: '../../jest.preset.js',
|
|
setupFilesAfterEnv: ['./setupTests.ts'],
|
|
testEnvironment: 'jsdom',
|
|
transformIgnorePatterns: ['../../node_modules/'],
|
|
transform: {
|
|
'^.+\\.(ts|js|tsx|jsx)$': '@swc/jest',
|
|
},
|
|
moduleNameMapper: {
|
|
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
|
'<rootDir>/__mocks__/imageMock.js',
|
|
'\\.css$': '<rootDir>/__mocks__/styleMock.js',
|
|
...pathsToModuleNameMapper(compilerOptions.paths),
|
|
},
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
|
coverageThreshold: {
|
|
global: {
|
|
statements: 65,
|
|
lines: 65,
|
|
functions: 55,
|
|
},
|
|
},
|
|
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
|
|
coveragePathIgnorePatterns: [
|
|
'states/.+State.ts$',
|
|
'states/selectors/*',
|
|
'contexts/.+Context.ts',
|
|
'testing/*',
|
|
'tests/*',
|
|
'config/*',
|
|
'graphql/queries/*',
|
|
'graphql/mutations/*',
|
|
'graphql/fragments/*',
|
|
'types/*',
|
|
'constants/*',
|
|
'generated-metadata/*',
|
|
'generated/*',
|
|
'__stories__/*',
|
|
'display/icon/index.ts',
|
|
],
|
|
coverageDirectory: './coverage',
|
|
};
|
|
|
|
export default jestConfig;
|