chore: include react components in twenty-ui test config (#4709)

Split from https://github.com/twentyhq/twenty/pull/4518

Part of https://github.com/twentyhq/twenty/issues/4766

- Re-generates some of the twenty-ui test and storybook config with Nx
- Includes tsx files in twenty-ui tests and compiles them with swc

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Thaïs
2024-04-04 12:30:49 +02:00
committed by GitHub
parent 932a8d68f5
commit eef1211463
12 changed files with 97 additions and 35 deletions

View File

@ -1,11 +1,23 @@
/* eslint-disable */
export default {
import { JestConfigWithTsJest } from 'ts-jest';
const jestConfig: JestConfigWithTsJest = {
displayName: 'twenty-ui',
preset: '../../jest.preset.js',
testEnvironment: 'node',
setupFilesAfterEnv: ['./setupTests.ts'],
transformIgnorePatterns: ['../../node_modules/'],
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
'^.+\\.[tj]sx?$': [
'@swc/jest',
{
jsc: {
parser: { syntax: 'typescript', tsx: true },
transform: { react: { runtime: 'automatic' } },
},
},
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/packages/twenty-ui',
};
export default jestConfig;