569d887d1e
Renaming the package so any further PRs directed to the website are targeted to the reworked code instead of diverging. Once merged, I will start preparing this for deployment to dev to test before releasing to prod. Any improvements will also be applied to this package. I avoided making significant changes to API routes so nothing breaks, but will test it thoroughly today to confirm. That said, everything is ported - double checked. Big diff PR, impossible to review, but last one! No more rebuilds.
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
const baseProject = {
|
|
preset: '../../jest.preset.js',
|
|
setupFilesAfterEnv: ['<rootDir>/test/setup-jest-dom.ts'],
|
|
transformIgnorePatterns: [
|
|
'/node_modules/(?!(twenty-ui|twenty-shared)/.*)',
|
|
'../../node_modules/(?!(twenty-ui|twenty-shared)/.*)',
|
|
],
|
|
transform: {
|
|
'^.+\\.(ts|js|tsx|jsx|mjs)$': [
|
|
'@swc/jest',
|
|
{
|
|
jsc: {
|
|
parser: { syntax: 'typescript', tsx: true },
|
|
transform: { react: { runtime: 'automatic' } },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
'^@lingui/core/macro$': '<rootDir>/test/lingui-macro-mock.ts',
|
|
},
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'mjs'],
|
|
};
|
|
|
|
const jestConfig = {
|
|
projects: [
|
|
{
|
|
...baseProject,
|
|
displayName: 'node',
|
|
testEnvironment: 'node',
|
|
testMatch: ['<rootDir>/src/**/*.test.ts'],
|
|
},
|
|
{
|
|
...baseProject,
|
|
displayName: 'jsdom',
|
|
testEnvironment: 'jsdom',
|
|
testMatch: ['<rootDir>/src/**/*.test.tsx'],
|
|
},
|
|
],
|
|
coverageDirectory: './coverage',
|
|
};
|
|
|
|
export default jestConfig;
|