mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:18:03 +00:00
chore(jest): modulePathIgnorePatterns
This commit is contained in:
parent
d81d1979b0
commit
76bbdfb1f6
@ -1,5 +1,14 @@
|
||||
const dotenv = require('dotenv');
|
||||
const { existsSync } = require('fs');
|
||||
const { resolve } = require('path')
|
||||
const yargs = require('yargs');
|
||||
|
||||
const envFile = existsSync(resolve(__dirname, '.env.test')) ? '.env.test' : '.env';
|
||||
|
||||
dotenv.config({
|
||||
path: resolve(__dirname, envFile),
|
||||
});
|
||||
|
||||
if (yargs.argv.dbDialect) {
|
||||
process.env.DB_DIALECT = yargs.argv.dbDialect;
|
||||
}
|
||||
|
@ -7,10 +7,7 @@ module.exports = {
|
||||
testEnvironment: 'jsdom',
|
||||
preset: 'ts-jest',
|
||||
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)'],
|
||||
setupFilesAfterEnv: [
|
||||
require.resolve('jest-dom/extend-expect'),
|
||||
'./jest.setup.ts',
|
||||
],
|
||||
setupFilesAfterEnv: [require.resolve('jest-dom/extend-expect'), './jest.setup.ts'],
|
||||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
|
||||
prefix: '<rootDir>/',
|
||||
}),
|
||||
@ -21,6 +18,7 @@ module.exports = {
|
||||
diagnostics: false,
|
||||
},
|
||||
},
|
||||
modulePathIgnorePatterns: ['/esm/', '/lib/'],
|
||||
coveragePathIgnorePatterns: [
|
||||
'/node_modules/',
|
||||
'/__tests__/',
|
||||
@ -30,4 +28,4 @@ module.exports = {
|
||||
'/demo/',
|
||||
'package-lock.json',
|
||||
],
|
||||
}
|
||||
};
|
||||
|
@ -1,14 +1,5 @@
|
||||
import dotenv from 'dotenv';
|
||||
import { existsSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import prettyFormat from 'pretty-format';
|
||||
|
||||
const envFile = existsSync(resolve(__dirname, '.env.test')) ? '.env.test' : '.env';
|
||||
|
||||
dotenv.config({
|
||||
path: resolve(__dirname, envFile),
|
||||
});
|
||||
|
||||
global['prettyFormat'] = prettyFormat;
|
||||
|
||||
jest.setTimeout(300000);
|
||||
|
Loading…
Reference in New Issue
Block a user