AppFlowy/frontend/appflowy_web_app/jest.config.cjs
Kilu.He 4d42c9ea68
feat: support document apply remote events (#5436)
* feat: support document apply remote events

* fix: add tests for database

* fix: add test for filter,sort and group

* fix: jest ci

* fix: jest ci

* fix: jest ci

* fix: jest ci

* fix: cypress test
2024-06-03 11:20:45 +08:00

23 lines
783 B
JavaScript

const { compilerOptions } = require('./tsconfig.json');
const { pathsToModuleNameMapper } = require('ts-jest');
const esModules = ['lodash-es', 'nanoid'].join('|');
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths),
'^lodash-es(/(.*)|$)': 'lodash$1',
'^nanoid(/(.*)|$)': 'nanoid$1',
},
'transform': {
'(.*)/node_modules/nanoid/.+\\.(j|t)sx?$': 'ts-jest',
},
'transformIgnorePatterns': [`/node_modules/(?!${esModules})`],
testMatch: ['**/*.test.ts'],
coverageDirectory: '<rootDir>/coverage/jest',
collectCoverage: true,
};