mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 05:38:23 +08:00
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
const { pathsToModuleNameMapper } = require('ts-jest/utils');
|
|
const { compilerOptions } = require('./tsconfig.json');
|
|
const { defaults } = require('jest-config');
|
|
|
|
module.exports = {
|
|
rootDir: process.cwd(),
|
|
collectCoverage: false,
|
|
verbose: true,
|
|
testEnvironment: 'jsdom',
|
|
preset: 'ts-jest',
|
|
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)'],
|
|
setupFiles: ['./jest.setup.ts'],
|
|
setupFilesAfterEnv: [require.resolve('jest-dom/extend-expect'), './jest.setupAfterEnv.ts'],
|
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
|
|
prefix: '<rootDir>/',
|
|
}),
|
|
globals: {
|
|
'ts-jest': {
|
|
babelConfig: false,
|
|
tsconfig: './tsconfig.jest.json',
|
|
diagnostics: false,
|
|
},
|
|
},
|
|
modulePathIgnorePatterns: ['/esm/', '/es/', '/dist/', '/lib/'],
|
|
// add .mjs .cjs for formula.js
|
|
moduleFileExtensions: [...defaults.moduleFileExtensions, 'mjs', 'cjs'],
|
|
coveragePathIgnorePatterns: [
|
|
'/node_modules/',
|
|
'/__tests__/',
|
|
'/esm/',
|
|
'/lib/',
|
|
'package.json',
|
|
'/demo/',
|
|
'package-lock.json',
|
|
],
|
|
};
|