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