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 — Merge pull request #402 from alibaba/feat/render-jest-config · webstager/lowcode-engine@670eeb9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • cov packages.yml
  • 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

‎.github/workflows/cov packages.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/cov packages.yml
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,40 @@ jobs:
2424
with:
2525
working-directory: packages/designer
2626
test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json
27+
skip-step: install
28+
cov-renderer-core:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: checkout
32+
uses: actions/checkout@v2
33+
34+
- uses: actions/setup-node@v2
35+
with:
36+
node-version: '14'
37+
38+
- name: install
39+
run: npm i && npm run setup:skip-build
40+
41+
- uses: ArtiomTr/jest-coverage-report-action@v2
42+
with:
43+
working-directory: packages/renderer-core
44+
test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json
45+
skip-step: install
46+
cov-react-simulator-renderer:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: checkout
50+
uses: actions/checkout@v2
51+
52+
- uses: actions/setup-node@v2
53+
with:
54+
node-version: '14'
55+
56+
- name: install
57+
run: npm i && npm run setup:skip-build
58+
59+
- uses: ArtiomTr/jest-coverage-report-action@v2
60+
with:
61+
working-directory: packages/react-simulator-renderer
62+
test-script: npm test -- --jest-ci --jest-json --jest-coverage --jest-testLocationInResults --jest-outputFile=report.json
2763
skip-step: install
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.