add card test with *.js

Signed-off-by: lihong <lihong67@huawei.com>
Change-Id: Ide01b23857f0ced78b392c4ce35fc27e8da82c2d
This commit is contained in:
lihong
2021-09-22 19:06:46 +08:00
parent 05d2a953c8
commit 26f0e8404e
8 changed files with 1132 additions and 1836 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -24,9 +24,7 @@ const codegen = require("./codegen/index.js");
module.exports = function (source, map) {
this.cacheable && this.cacheable();
const callback = this.async();
if (process.env.DEVICE_LEVEL === 'card') {
codegen = require('./codegen/card-index.js');
}
const parsed = codegen.genHmlAndCss(source);
const loaderQuery = loaderUtils.getOptions(this) || {};
if (parsed.errorType && parsed.errorType !== '') {
@@ -0,0 +1,16 @@
{
"template": {
"attr": {},
"classList": [
"container"
],
"type": "div"
},
"styles": {},
"actions": {},
"data": {
"event": "$event.talk",
"name": "{{map.amy}}"
},
"apiVersion": {}
}
+4
View File
@@ -93,4 +93,8 @@ describe('build', () => {
const page = 'showAttr'
expect(getActualJSON(page, 'showAttr')).eql(getExpectJSON(page, 'showAttr'));
});
it('withJS', () => {
const page = 'withJS'
expect(getActualJSON(page, 'withJS')).eql(getExpectJSON(page, 'withJS'));
})
});
+2 -1
View File
@@ -15,7 +15,8 @@
"pages/inlineStyle/inlineStyle",
"pages/mediaQuery/mediaQuery",
"pages/privateAttr/privateAttr",
"pages/showAttr/showAttr"
"pages/showAttr/showAttr",
"pages/withJS/withJS"
],
"window": {
"designWidth": 720,
@@ -0,0 +1,2 @@
<div class="container">
</div>
@@ -0,0 +1,6 @@
export default {
data: {
name: this.map['amy'],
event: $event.talk
}
}