Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: alibaba/lowcode-engine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 94dd25f55a24e806ea937aa2b54c73761c40fdfb
Choose a base ref
..
head repository: alibaba/lowcode-engine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6b23f5429a0052617c0ea3964b3f69c68f3c4a91
Choose a head ref
Showing with 14 additions and 19 deletions.
  1. +14 −19 packages/plugin-command/jest.config.js
33 changes: 14 additions & 19 deletions packages/plugin-command/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
const esModules = [
'@recore/obx-react',
// '@ali/lowcode-editor-core',
].join('|');
const fs = require('fs');
const { join } = require('path');
const esModules = [].join('|');
const pkgNames = fs.readdirSync(join('..')).filter(pkgName => !pkgName.startsWith('.'));

module.exports = {
// transform: {
// '^.+\\.[jt]sx?$': 'babel-jest',
// // '^.+\\.(ts|tsx)$': 'ts-jest',
// // '^.+\\.(js|jsx)$': 'babel-jest',
// },
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
const jestConfig = {
transformIgnorePatterns: [
`/node_modules/(?!${esModules})/`,
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
collectCoverage: false,
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/base/**',
'!src/fields/**',
'!src/prop.ts',
'!**/node_modules/**',
'!**/vendor/**',
'src/**/*.ts',
'src/**/*.tsx',
],
};

// 只对本仓库内的 pkg 做 mapping
jestConfig.moduleNameMapper = {};
jestConfig.moduleNameMapper[`^@alilc/lowcode\\-(${pkgNames.join('|')})$`] = '<rootDir>/../$1/src';

module.exports = jestConfig;