123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 'use strict';
- /**
- *
- *
- * @author Mai
- * @date
- * @version
- */
- const { app, assert } = require('egg-mock/bootstrap');
- const path = require('path');
- let savePath;
- const mockData = {};
- describe('test/app/service/report_memory.test.js', () => {
- // 准备测试数据
- before(function* () {
- const ctx = app.mockContext();
- savePath = path.join(ctx.app.baseDir,'report_temp');
- const postData = {
- account: '734406061@qq.com',
- project: 'T201711273363',
- project_password: 'mai654321',
- };
- ctx.session = {};
- const loginResult = yield ctx.service.projectAccount.accountLogin(postData, 2);
- assert(loginResult);
- mockData.session = ctx.session;
- });
- // 期部位明细数据
- it('test getStagePos', function* () {
- const ctx = app.mockContext(mockData);
- // test12 - 第6期
- const stage = yield ctx.service.stage.getDataByCondition({tid: 12, order: 6});
- const mainData = yield ctx.service.reportMemory.getStagePosCompareData(12, stage.id);
- if (mainData instanceof Array) {
- yield ctx.helper.saveBufferFile(JSON.stringify(mainData,"","\t"), path.join(savePath, 'mem_stage_pos_compare.json'));
- }
- });
- });
|