GeezerVison is showing github.com — chore(editor-core): init test · cdlinsen/lowcode-engine@dca3448
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/test packages.yml +17-1Lines changed: 17 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -105,4 +105,20 @@ jobs: | 105 | 105 | run: npm i && npm run setup:skip-build | 106 | 106 |
| 107 | 107 | - name: test | 108 | | - run: cd packages/utils && npm test | | 108 | + run: cd packages/utils && npm test | | 109 | + | | 110 | + test-editor-core: | | 111 | + runs-on: ubuntu-latest | | 112 | + steps: | | 113 | + - name: checkout | | 114 | + uses: actions/checkout@v2 | | 115 | + | | 116 | + - uses: actions/setup-node@v2 | | 117 | + with: | | 118 | + node-version: '14' | | 119 | + | | 120 | + - name: install | | 121 | + run: npm i && npm run setup:skip-build | | 122 | + | | 123 | + - name: test | | 124 | + run: cd packages/editor-core && npm test |
Collapse file Copy file name to clipboard +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{ | | 2 | + "plugins": [ | | 3 | + "@alilc/build-plugin-lce", | | 4 | + "@alilc/lowcode-test-mate/plugin/index.ts" | | 5 | + ], | | 6 | + "babelPlugins": [ | | 7 | + ["@babel/plugin-proposal-private-property-in-object", { "loose": true }] | | 8 | + ] | | 9 | +} |
Collapse file Copy file name to clipboard +26Lines changed: 26 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +const fs = require('fs'); | | 2 | +const { join } = require('path'); | | 3 | +const esModules = [].join('|'); | | 4 | +const pkgNames = fs.readdirSync(join('..')).filter(pkgName => !pkgName.startsWith('.')); | | 5 | + | | 6 | +const jestConfig = { | | 7 | + transformIgnorePatterns: [ | | 8 | + `/node_modules/(?!${esModules})/`, | | 9 | + ], | | 10 | + moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], | | 11 | + collectCoverage: false, | | 12 | + collectCoverageFrom: [ | | 13 | + 'src/**/*.ts', | | 14 | + '!src/**/*.d.ts', | | 15 | + '!src/icons/**', | | 16 | + '!src/locale/**', | | 17 | + '!**/node_modules/**', | | 18 | + '!**/vendor/**', | | 19 | + ], | | 20 | +}; | | 21 | + | | 22 | +// 只对本仓库内的 pkg 做 mapping | | 23 | +jestConfig.moduleNameMapper = {}; | | 24 | +jestConfig.moduleNameMapper[`^@alilc/lowcode\\-(${pkgNames.join('|')})$`] = '<rootDir>/../$1/src'; | | 25 | + | | 26 | +module.exports = jestConfig; |
Collapse file Copy file name to clipboardExpand all lines: packages/editor-core/package.json +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | "es" | 11 | 11 | ], | 12 | 12 | "scripts": { | 13 | | - "build": "build-scripts build" | | 13 | + "build": "build-scripts build", | | 14 | + "test": "build-scripts test --config build.test.json", | | 15 | + "test:cov": "build-scripts test --config build.test.json --jest-coverage" | 14 | 16 | }, | 15 | 17 | "dependencies": { | 16 | 18 | "@alifd/next": "^1.19.16", | |
|