Skip to content

Commit

Permalink
增加单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwmg committed Nov 22, 2019
1 parent 9728bc4 commit f290f67
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/chameleon-css-loader/test/parser-test/miniapp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ const expect = require('chai').expect;
let source = `body {width:100cpx;font-size:26px;/* height:200px; */}`;
describe('parse/miniapp', function() {
it('parse cssstyle px to rpx but leave comment in style alone', function() {
let result = parseCss(source);
let result = parseCss(source,{
cmlType:'alipay',
filePath:"chameleon-runtime/src/platform/alipay/style/index.css"
});
expect(/100rpx/.test(result)).to.be.ok;
})
it('parse cssstyle px to rpx but leave comment in style alone', function() {
let result = parseCss(source,{
cmlType:'wx',
filePath:"chameleon-runtime/src/platform/alipay/style/index.css"
});
expect(/100rpx/.test(result)).to.be.ok;
})
})

0 comments on commit f290f67

Please sign in to comment.