mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-18 16:54:27 -04:00
update ut Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: Idc55ed099fb4cc0040f1078116d7a8b7b74adfd7
This commit is contained in:
@@ -17,7 +17,10 @@
|
||||
"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",
|
||||
"richtest": "npm run build && cd test/rich/testcase && webpack --config ../../../webpack.rich.config.js && mocha ../test.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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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