提交 575cbb83 编写于 作者: K kevinluohuan

添加 cml-interface-parser include 功能相关 case

上级 e6fc6b2e
......@@ -4,7 +4,7 @@ const expect = chai.expect;
const Parser = require('../index');
describe('parser check', function() {
it('should pass check', function() {
it('normal interface file: should pass check', function() {
let parser = new Parser({filePath: path.resolve(__dirname, './docs/index.interface')});
let results = parser.getParseResults();
expect(results).to.have.deep.property('vars', ['cstyle', 'bottomOffset', 'scrollDirection']);
......@@ -17,4 +17,17 @@ describe('parser check', function() {
name: 'scrollDirection', valueType: 'String', props: [], typeChain: []
}]);
});
it('include interface file: should pass check', function() {
let parser = new Parser({filePath: path.resolve(__dirname, './docs/include-interface.interface')});
let results = parser.getParseResults();
expect(results).to.have.deep.property('vars', ['cstyle', 'bottomOffset', 'scrollDirection']);
expect(results).to.have.deep.property('methods', ['customscroll', 'scrolltobottom']);
expect(results).to.have.deep.property('props', [{
name: 'cstyle', valueType: 'String', props: [], typeChain: []
}, {
name: 'bottomOffset', valueType: 'Number', props: [], typeChain: []
}, {
name: 'scrollDirection', valueType: 'String', props: [], typeChain: []
}]);
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册