mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-09-11 11:15:53 +03:00
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
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: 'jsdom',
|
|
roots: ['<rootDir>'],
|
|
modulePaths: [compilerOptions.baseUrl],
|
|
moduleNameMapper: {
|
|
...pathsToModuleNameMapper(compilerOptions.paths),
|
|
'^lodash-es(/(.*)|$)': 'lodash$1',
|
|
'^nanoid(/(.*)|$)': 'nanoid$1',
|
|
},
|
|
'transform': {
|
|
'^.+\\.(j|t)sx?$': 'ts-jest',
|
|
'(.*)/node_modules/nanoid/.+\\.(j|t)sx?$': 'ts-jest',
|
|
},
|
|
'transformIgnorePatterns': [`/node_modules/(?!${esModules})`],
|
|
testMatch: ['**/*.test.ts', '**/*.test.tsx'],
|
|
coverageDirectory: '<rootDir>/coverage/jest',
|
|
collectCoverage: true,
|
|
coverageProvider: 'v8',
|
|
coveragePathIgnorePatterns: [
|
|
'/cypress/',
|
|
'/coverage/',
|
|
'/node_modules/',
|
|
'/__tests__/',
|
|
'/__mocks__/',
|
|
'/__fixtures__/',
|
|
'/__helpers__/',
|
|
'/__utils__/',
|
|
'/__constants__/',
|
|
'/__types__/',
|
|
'/__mocks__/',
|
|
'/__stubs__/',
|
|
'/__fixtures__/',
|
|
'/application/folder-yjs/',
|
|
],
|
|
}; |