2020-10-24 07:34:43 +00:00
|
|
|
const path = require('path');
|
2021-12-04 08:28:52 +00:00
|
|
|
const { pathsToModuleNameMapper } = require('ts-jest/utils');
|
|
|
|
const { compilerOptions } = require('./tsconfig.jest.json');
|
2020-10-24 07:34:43 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
preset: 'ts-jest',
|
|
|
|
testEnvironment: 'node',
|
2021-05-23 00:38:08 +00:00
|
|
|
setupFilesAfterEnv: [
|
|
|
|
path.resolve(__dirname, 'dotenv.js'),
|
|
|
|
],
|
2020-10-24 07:34:43 +00:00
|
|
|
testMatch: [
|
|
|
|
// '**/__tests__/**/*.[jt]s?(x)',
|
|
|
|
'**/?(*.)+(spec|test).[jt]s?(x)'
|
|
|
|
],
|
2021-12-04 08:28:52 +00:00
|
|
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
|
|
|
|
prefix: '<rootDir>/',
|
|
|
|
}),
|
2020-12-02 05:23:09 +00:00
|
|
|
modulePathIgnorePatterns: [
|
2021-04-17 13:33:21 +00:00
|
|
|
"<rootDir>/.dumi/",
|
2021-05-23 00:38:08 +00:00
|
|
|
"<rootDir>/packages/father-build/",
|
|
|
|
"<rootDir>/packages/client/lib/"
|
2020-12-02 05:23:09 +00:00
|
|
|
],
|
2021-05-23 00:38:08 +00:00
|
|
|
globals: {
|
|
|
|
'ts-jest': {
|
|
|
|
babelConfig: true,
|
|
|
|
tsconfig: 'tsconfig.jest.json',
|
|
|
|
diagnostics: false,
|
|
|
|
},
|
|
|
|
},
|
2020-10-24 07:34:43 +00:00
|
|
|
};
|