mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-10 18:03:01 +00:00
chore(editor-core): init test
This commit is contained in:
parent
0e65f02116
commit
dca3448cbf
18
.github/workflows/test packages.yml
vendored
18
.github/workflows/test packages.yml
vendored
@ -105,4 +105,20 @@ jobs:
|
||||
run: npm i && npm run setup:skip-build
|
||||
|
||||
- name: test
|
||||
run: cd packages/utils && npm test
|
||||
run: cd packages/utils && npm test
|
||||
|
||||
test-editor-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: install
|
||||
run: npm i && npm run setup:skip-build
|
||||
|
||||
- name: test
|
||||
run: cd packages/editor-core && npm test
|
||||
9
packages/editor-core/build.test.json
Normal file
9
packages/editor-core/build.test.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugins": [
|
||||
"@alilc/build-plugin-lce",
|
||||
"@alilc/lowcode-test-mate/plugin/index.ts"
|
||||
],
|
||||
"babelPlugins": [
|
||||
["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
|
||||
]
|
||||
}
|
||||
26
packages/editor-core/jest.config.js
Normal file
26
packages/editor-core/jest.config.js
Normal file
@ -0,0 +1,26 @@
|
||||
const fs = require('fs');
|
||||
const { join } = require('path');
|
||||
const esModules = [].join('|');
|
||||
const pkgNames = fs.readdirSync(join('..')).filter(pkgName => !pkgName.startsWith('.'));
|
||||
|
||||
const jestConfig = {
|
||||
transformIgnorePatterns: [
|
||||
`/node_modules/(?!${esModules})/`,
|
||||
],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.ts',
|
||||
'!src/**/*.d.ts',
|
||||
'!src/icons/**',
|
||||
'!src/locale/**',
|
||||
'!**/node_modules/**',
|
||||
'!**/vendor/**',
|
||||
],
|
||||
};
|
||||
|
||||
// 只对本仓库内的 pkg 做 mapping
|
||||
jestConfig.moduleNameMapper = {};
|
||||
jestConfig.moduleNameMapper[`^@alilc/lowcode\\-(${pkgNames.join('|')})$`] = '<rootDir>/../$1/src';
|
||||
|
||||
module.exports = jestConfig;
|
||||
@ -10,7 +10,9 @@
|
||||
"es"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "build-scripts build"
|
||||
"build": "build-scripts build",
|
||||
"test": "build-scripts test --config build.test.json",
|
||||
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alifd/next": "^1.19.16",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user