# Introduction Dispatching root package.json devDeps, prod deps Taking care of keeping non imported module used at build/ci level in the root package.json ## Motivation Avoid redundant deps declaration, better scoping allow better workspace deps granularity installation. <img width="385" height="247" alt="image" src="https://github.com/user-attachments/assets/9d7162ec-ba01-4f58-8563-38333733fdf0" /> --------- Co-authored-by: Charles Bochet <charles@twenty.com>
62 lines
1.7 KiB
JavaScript
62 lines
1.7 KiB
JavaScript
import { createRequire } from 'module';
|
|
const require = createRequire(import.meta.url);
|
|
|
|
const jestConfig = {
|
|
// For more information please have a look to official docs https://jestjs.io/docs/configuration/#prettierpath-string
|
|
// Prettier v3 should be supported in jest v30 https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.1
|
|
prettierPath: null,
|
|
// to enable logs, comment out the following line
|
|
silent: true,
|
|
errorOnDeprecated: true,
|
|
clearMocks: true,
|
|
displayName: 'twenty-server',
|
|
rootDir: './',
|
|
testEnvironment: 'node',
|
|
setupFilesAfterEnv: ['./setupTests.ts'],
|
|
transformIgnorePatterns: [
|
|
'/node_modules/(?!(file-type|@file-type|strtok3|token-types|@borewit|@tokenizer|uint8array-extras|read-next-line|digest-fetch|md5|js-sha256|js-sha512|base-64|charenc|crypt)/)',
|
|
],
|
|
testRegex: '.*\\.spec\\.ts$',
|
|
transform: {
|
|
'^.+\\.(t|j)s$': [
|
|
'@swc/jest',
|
|
{
|
|
jsc: {
|
|
parser: {
|
|
syntax: 'typescript',
|
|
tsx: false,
|
|
decorators: true,
|
|
},
|
|
transform: {
|
|
decoratorMetadata: true,
|
|
},
|
|
experimental: {
|
|
plugins: [
|
|
[
|
|
'@lingui/swc-plugin',
|
|
{
|
|
stripNonEssentialFields: false,
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
moduleNameMapper: {
|
|
'^src/(.*)': '<rootDir>/src/$1',
|
|
'^test/(.*)': '<rootDir>/test/$1',
|
|
'^file-type$': require.resolve('file-type'),
|
|
},
|
|
moduleFileExtensions: ['js', 'json', 'ts'],
|
|
modulePathIgnorePatterns: ['<rootDir>/dist'],
|
|
fakeTimers: {
|
|
enableGlobally: true,
|
|
},
|
|
collectCoverageFrom: ['**/*.(t|j)s'],
|
|
coverageDirectory: '../coverage',
|
|
};
|
|
|
|
export default jestConfig;
|