UNPKG

isv-page-json-to-xtpl

Version:

abs 将页面 json 转换成 html

59 lines (49 loc) 1.47 kB
const depMap = require('../lib/dep-map'); const chai = require('chai'); const expect = chai.expect; const sinon = require('sinon'); const co = require('co'); describe('lib/dep-map', ()=> { it('should return object', (done)=>{ co(function*(){ const result = yield depMap([ { "group": "abs-mod", "name": "m-chi-theme-market", "version": "0.1.6" }, { "group": "abs-mod", "name": "m-chi-bangdan-lists", "version": "0.0.4" } ]); expect(result).to.be.a('object'); expect(result).to.have.property('packages'); expect(result).to.have.property('modules'); expect(result.loadErrorModules).to.be.empty; expect(result.modules).to.have.property('m-chi-theme-market/index'); expect(result.modules).to.have.property('m-chi-bangdan-lists/index'); done(); }); }); // 这个功能先在没有哦 // it('error should return loadErrorModules', (done)=>{ // // co(function*(){ // const result = yield depMap([ // { // "group": "abs-mod", // "name": "m-error", // "version": "0.1.6" // } // ]); // expect(result).to.be.a('object'); // expect(result).to.have.property('packages'); // expect(result).to.have.property('modules'); // expect(result.loadErrorModules.length).to.be.above(0); // done(); // }); // // }) });