1234567891011121314151617181920212223242526 |
- 'use strict';
- /**
- *
- *
- * @author Mai
- * @date
- * @version
- */
- const { app, assert } = require('egg-mock/bootstrap');
- const excel = require('node-xlsx');
- describe('test/app/service/deal_bills.test.js', () => {
- it('test import Excel data', function* () {
- const ctx = app.mockContext();
- const file = app.baseDir + '/test/app/test_file/deal-load-test.xls';
- const sheets = excel.parse(file), testTenderId = 3;
- const result = yield ctx.service.dealBills.importData(sheets[0], testTenderId);
- assert(result.length === 1);
- const bills = result[0];
- assert(bills.code === '101-1');
- assert(bills.tender_id === testTenderId);
- });
- });
|