GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: renderer jest config add collectCoverage · Alvison/lowcode-engine@38be3de

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-renderer
      • jest.config.js
    • react-simulator-renderer
      • jest.config.js
    • renderer-core
      • jest.config.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-renderer/jest.config.js‎

Copy file name to clipboard
+20-3Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
module.exports = {
1+
const fs = require('fs');
2+
const { join } = require('path');
3+
const esModules = ['zen-logger'].join('|');
4+
const pkgNames = fs.readdirSync(join('..')).filter(pkgName => !pkgName.startsWith('.'));
5+
6+
const jestConfig = {
27
// transform: {
38
// '^.+\\.[jt]sx?$': 'babel-jest',
49
// // '^.+\\.(ts|tsx)$': 'ts-jest',
510
// // '^.+\\.(js|jsx)$': 'babel-jest',
611
// },
12+
// testMatch: ['**/document/node/node.test.ts'],
13+
// testMatch: ['**/designer/builtin-hotkey.test.ts'],
14+
// testMatch: ['**/plugin/plugin-manager.test.ts'],
715
// testMatch: ['(/tests?/.*(test))\\.[jt]s$'],
16+
transformIgnorePatterns: [
17+
`/node_modules/(?!${esModules})/`,
18+
],
819
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
920
collectCoverage: true,
1021
collectCoverageFrom: [
11-
'src/**/*.{ts,tsx}',
22+
'src/**/*.ts',
23+
'!src/**/*.d.ts',
1224
'!**/node_modules/**',
13-
'!**/vendor/**',
1425
],
1526
};
27+
28+
// 只对本仓库内的 pkg 做 mapping
29+
jestConfig.moduleNameMapper = {};
30+
jestConfig.moduleNameMapper[`^@alilc/lowcode\\-(${pkgNames.join('|')})$`] = '<rootDir>/../$1/src';
31+
32+
module.exports = jestConfig;
Collapse file

‎packages/react-simulator-renderer/jest.config.js‎

Copy file name to clipboardExpand all lines: packages/react-simulator-renderer/jest.config.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const jestConfig = {
1818
],
1919
setupFiles: ['./test/utils/host.ts'],
2020
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
21-
collectCoverage: false,
21+
collectCoverage: true,
2222
collectCoverageFrom: [
2323
'src/**/*.ts',
2424
'!src/**/*.d.ts',
Collapse file

‎packages/renderer-core/jest.config.js‎

Copy file name to clipboardExpand all lines: packages/renderer-core/jest.config.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const jestConfig = {
1616
],
1717
setupFiles: ['./tests/fixtures/unhandled-rejection.ts'],
1818
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
19-
collectCoverage: false,
19+
collectCoverage: true,
2020
collectCoverageFrom: [
2121
'src/**/*.ts',
2222
'!src/**/*.d.ts',

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.