test: 修复几个单测问题, 支持 aone 实验室

This commit is contained in:
力皓 2021-03-12 11:31:06 +08:00
parent b9c5b3a0fd
commit 67a69ea6cb
7 changed files with 9 additions and 8 deletions

View File

@ -8,6 +8,7 @@ dist
demo
es
lib
tests
.*
~*

View File

@ -1,6 +1,5 @@
module.exports = {
extends: 'eslint-config-ali/typescript/react',
ignorePatterns: [ 'tests/** '],
rules: {
'react/no-multi-comp': 0,
'no-unused-expressions': 0,
@ -27,5 +26,7 @@ module.exports = {
'no-proto': 0,
'prefer-const': 0,
'eol-last': 0,
'react/no-find-dom-node': 0,
'no-case-declarations': 0,
}
};

View File

@ -26,7 +26,7 @@
"test:snapshot": "lerna run test:snapshot",
"watchdog:build": "node ./scripts/watchdog.js",
"xima:fix": "xima fix",
"xima:scan": "xima scan"
"xima:scan": "xima scan --quiet"
},
"husky": {
"hooks": {
@ -39,12 +39,9 @@
"**/*.{js,jsx,ts,tsx}": "xima exec eslint"
},
"devDependencies": {
"ava": "^1.0.1",
"@ali/lerna": "^1",
"ts-node": "^7.0.1",
"tslib": "^1.9.3",
"typescript": "^3.2.2",
"xima": "^0.2.15"
"xima": "^0.3.0"
},
"engines": {
"node": ">=14.0.0"

View File

@ -41,6 +41,7 @@
"build-scripts-config": "^0.1.8",
"jest": "^26.6.3",
"lodash": "^4.17.20",
"moment": "^2.29.1",
"typescript": "^4.0.3"
},
"publishConfig": {

View File

@ -929,7 +929,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
return null;
}
if (node.componentMeta?.getMetadata().configure.component?.isModal) {
if (node?.componentMeta?.getMetadata().configure.component?.isModal) {
return { container: this.document.rootNode, ref };
}

View File

@ -20,7 +20,7 @@ exports[`valueToSource 5`] = `
exports[`valueToSource 6`] = `"null"`;
exports[`valueToSource 7`] = `"function haha() {}"`;
exports[`valueToSource 7`] = `"() => {}"`;
exports[`valueToSource 8`] = `"new Map()"`;

View File

@ -1,3 +1,4 @@
module.exports = {
eslintType: 'typescript/react',
enableStylelint: false,
};