2024-05-10 11:26:46 +03:00
|
|
|
import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest';
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
const tsConfig = require('./tsconfig.json');
|
|
|
|
|
|
|
|
const jestConfig: JestConfigWithTsJest = {
|
2024-03-13 16:21:18 +03:00
|
|
|
displayName: 'twenty-ui',
|
|
|
|
preset: '../../jest.preset.js',
|
2024-04-04 13:30:49 +03:00
|
|
|
setupFilesAfterEnv: ['./setupTests.ts'],
|
2024-04-04 16:38:01 +03:00
|
|
|
testEnvironment: 'jsdom',
|
2024-04-04 13:30:49 +03:00
|
|
|
transformIgnorePatterns: ['../../node_modules/'],
|
2024-03-13 16:21:18 +03:00
|
|
|
transform: {
|
2024-04-04 13:30:49 +03:00
|
|
|
'^.+\\.[tj]sx?$': [
|
|
|
|
'@swc/jest',
|
|
|
|
{
|
|
|
|
jsc: {
|
|
|
|
parser: { syntax: 'typescript', tsx: true },
|
|
|
|
transform: { react: { runtime: 'automatic' } },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-03-13 16:21:18 +03:00
|
|
|
},
|
2024-05-10 11:26:46 +03:00
|
|
|
moduleNameMapper: {
|
|
|
|
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
|
|
|
'<rootDir>/__mocks__/imageMock.js',
|
|
|
|
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths),
|
|
|
|
},
|
2024-04-04 13:30:49 +03:00
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
2024-04-04 16:38:01 +03:00
|
|
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
|
|
|
coverageDirectory: './coverage',
|
2024-03-13 16:21:18 +03:00
|
|
|
};
|
2024-05-10 11:26:46 +03:00
|
|
|
|
|
|
|
export default jestConfig;
|