!144 update rich ut

Merge pull request !144 from houhaoyu/master
This commit is contained in:
openharmony_ci
2022-01-20 13:17:37 +00:00
committed by Gitee
5 changed files with 13 additions and 3 deletions
+5 -1
View File
@@ -16,7 +16,11 @@
"rich": "cd sample/rich && webpack --config ../../webpack.rich.config.js",
"lite": "cd sample/lite && webpack --config ../../webpack.lite.config.js",
"card": "cd sample/card && webpack --config ../../webpack.rich.config.js",
"postinstall": "node npm-install.js"
"postinstall": "node npm-install.js",
"richtest": "cd test/rich/testcase && webpack --config ../../../webpack.rich.config.js && mocha ../test.js",
"litetest": "cd test/lite/testcase && webpack --config ../../../webpack.lite.config.js && mocha ../test.js",
"cardtest": "cd test/card/testcase && webpack --env utTestForCard --config ../../../webpack.rich.config.js && mocha ../test.js",
"test": "npm run build && npm run richtest && npm run litetest && npm run cardtest"
},
"devDependencies": {
"chai": "^3.5.0",
+2 -1
View File
@@ -33,9 +33,10 @@ function getJsBundle(componentName) {
}
function getExpectedObj(componentName) {
const matchHashComment = /\/\*(.|\n|\r)+\*\//;
const filepath = path.join(__dirname, "expected", `${componentName}.js`);
const expectedContent = fs.readFileSync(filepath, "utf-8");
const expectedObj = JSON.parse(expectedContent.toString());
const expectedObj = JSON.parse(expectedContent.toString().replace(matchHashComment, ''));
return expectedObj;
}
@@ -468,8 +468,10 @@
},
{
"type": "xcomponent",
"id": "1",
"attr": {
"debugLine": "pages/privateAttr/privateAttr:130",
"id": "1",
"name": "function () {return this.name}",
"type": "texture"
}
@@ -127,7 +127,7 @@
<stepper index="1"></stepper>
<!-- xcomponent_test -->
<xcomponent name="{{name}}" type="texture"></xcomponent>
<xcomponent name="{{name}}" type="texture" id="1"></xcomponent>
<!-- web_test -->
<web src="{{src}}"></web>
+3
View File
@@ -178,6 +178,9 @@ let config = {
}
function setConfigs(env) {
if (env.utTestForCard) {
env.DEVICE_LEVEL = "card";
}
if (process.env.aceModuleJsonPath || env.aceModuleJsonPath) {
process.env.compileMode = 'moduleJson';
}