mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-19 10:15:08 -04:00
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user