mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
chore: renderer jest config add collectCoverage
This commit is contained in:
parent
2dfdba3399
commit
38be3dec83
@ -1,15 +1,32 @@
|
|||||||
module.exports = {
|
const fs = require('fs');
|
||||||
|
const { join } = require('path');
|
||||||
|
const esModules = ['zen-logger'].join('|');
|
||||||
|
const pkgNames = fs.readdirSync(join('..')).filter(pkgName => !pkgName.startsWith('.'));
|
||||||
|
|
||||||
|
const jestConfig = {
|
||||||
// transform: {
|
// transform: {
|
||||||
// '^.+\\.[jt]sx?$': 'babel-jest',
|
// '^.+\\.[jt]sx?$': 'babel-jest',
|
||||||
// // '^.+\\.(ts|tsx)$': 'ts-jest',
|
// // '^.+\\.(ts|tsx)$': 'ts-jest',
|
||||||
// // '^.+\\.(js|jsx)$': 'babel-jest',
|
// // '^.+\\.(js|jsx)$': 'babel-jest',
|
||||||
// },
|
// },
|
||||||
|
// testMatch: ['**/document/node/node.test.ts'],
|
||||||
|
// testMatch: ['**/designer/builtin-hotkey.test.ts'],
|
||||||
|
// testMatch: ['**/plugin/plugin-manager.test.ts'],
|
||||||
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
|
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
|
||||||
|
transformIgnorePatterns: [
|
||||||
|
`/node_modules/(?!${esModules})/`,
|
||||||
|
],
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
||||||
collectCoverage: true,
|
collectCoverage: true,
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'src/**/*.{ts,tsx}',
|
'src/**/*.ts',
|
||||||
|
'!src/**/*.d.ts',
|
||||||
'!**/node_modules/**',
|
'!**/node_modules/**',
|
||||||
'!**/vendor/**',
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 只对本仓库内的 pkg 做 mapping
|
||||||
|
jestConfig.moduleNameMapper = {};
|
||||||
|
jestConfig.moduleNameMapper[`^@alilc/lowcode\\-(${pkgNames.join('|')})$`] = '<rootDir>/../$1/src';
|
||||||
|
|
||||||
|
module.exports = jestConfig;
|
||||||
@ -18,7 +18,7 @@ const jestConfig = {
|
|||||||
],
|
],
|
||||||
setupFiles: ['./test/utils/host.ts'],
|
setupFiles: ['./test/utils/host.ts'],
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
||||||
collectCoverage: false,
|
collectCoverage: true,
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'src/**/*.ts',
|
'src/**/*.ts',
|
||||||
'!src/**/*.d.ts',
|
'!src/**/*.d.ts',
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const jestConfig = {
|
|||||||
],
|
],
|
||||||
setupFiles: ['./tests/fixtures/unhandled-rejection.ts'],
|
setupFiles: ['./tests/fixtures/unhandled-rejection.ts'],
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
||||||
collectCoverage: false,
|
collectCoverage: true,
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'src/**/*.ts',
|
'src/**/*.ts',
|
||||||
'!src/**/*.d.ts',
|
'!src/**/*.d.ts',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user