From a4f8a5818f752b4cf31461202962fa8015ee1440 Mon Sep 17 00:00:00 2001 From: liujuping Date: Tue, 29 Mar 2022 16:44:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=8E=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=84=E4=BB=B6=E4=BD=BF=E7=94=A8=E6=97=B6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=20noContainer=20props=20=E5=87=BA=E7=8E=B0=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react-simulator-renderer/build.test.json | 6 ++++++ .../react-simulator-renderer/jest.config.js | 20 +++++++++++++++++++ .../react-simulator-renderer/package.json | 1 + .../renderer-core/src/renderer/component.tsx | 2 +- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 packages/react-simulator-renderer/build.test.json create mode 100644 packages/react-simulator-renderer/jest.config.js diff --git a/packages/react-simulator-renderer/build.test.json b/packages/react-simulator-renderer/build.test.json new file mode 100644 index 000000000..228c07e7f --- /dev/null +++ b/packages/react-simulator-renderer/build.test.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "build-plugin-component", + "@ali/lowcode-test-mate/plugin/index.ts" + ] +} diff --git a/packages/react-simulator-renderer/jest.config.js b/packages/react-simulator-renderer/jest.config.js new file mode 100644 index 000000000..865d30116 --- /dev/null +++ b/packages/react-simulator-renderer/jest.config.js @@ -0,0 +1,20 @@ +const esModules = ['@recore/obx-react'].join('|'); + +module.exports = { + // transform: { + // '^.+\\.[jt]sx?$': 'babel-jest', + // // '^.+\\.(ts|tsx)$': 'ts-jest', + // // '^.+\\.(js|jsx)$': 'babel-jest', + // }, + // testMatch: ['(/tests?/.*(test))\\.[jt]s$'], + transformIgnorePatterns: [ + `/node_modules/(?!${esModules})/`, + ], + moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], + collectCoverage: true, + collectCoverageFrom: [ + 'src/**/*.{ts,tsx}', + '!**/node_modules/**', + '!**/vendor/**', + ], +}; diff --git a/packages/react-simulator-renderer/package.json b/packages/react-simulator-renderer/package.json index e0a072e8e..faca4ad99 100644 --- a/packages/react-simulator-renderer/package.json +++ b/packages/react-simulator-renderer/package.json @@ -10,6 +10,7 @@ "lib" ], "scripts": { + "test": "build-scripts test --config build.test.json", "build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo", "cloud-build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.cloud.json" }, diff --git a/packages/renderer-core/src/renderer/component.tsx b/packages/renderer-core/src/renderer/component.tsx index 81b40dc32..e6d936901 100644 --- a/packages/renderer-core/src/renderer/component.tsx +++ b/packages/renderer-core/src/renderer/component.tsx @@ -30,7 +30,7 @@ export default function componentRendererFactory() { }); this.__render(); - const { noContainer } = this.__parseData(__schema.props); + const noContainer = this.__parseData(__schema.props?.noContainer); if (noContainer) { return this.__renderContextProvider({ compContext: this });