import { createOptions, TestProjectId, TestTokens, setupTokens } from '../test.config'; import { ElectricAccumulationService } from '../api/electricAccumulation.service'; jest.setTimeout(10000); const factory = createOptions(); const service = new ElectricAccumulationService(factory); beforeAll(async () => { await setupTokens(); }); test('加载用电量汇总', async () => { console.log('加载用电量汇总'); const result = await service.loadElectricAccumulation(TestProjectId); console.log(result); expect(result).not.toBeNull(); }); test('加载用电设备近一个月预警信息', async () => { console.log('加载用电设备近一个月预警信息'); const result = await service.loadElectricDeviceAlarm(TestProjectId); console.log(result); expect(result).not.toBeNull(); }); test('加载用电设备近一个月平均漏电流信息', async () => { console.log('加载用电设备近一个月平均漏电流信息'); const result = await service.loadElectricDeviceAlarm(TestProjectId); console.log(result); expect(result).not.toBeNull(); }); test('加载用电设备近一个月预警信息', async () => { console.log('加载用电设备近一个月预警信息'); const result = await service.loadElectricDeviceAlarm(TestProjectId); console.log(result); expect(result).not.toBeNull(); }); test('用电设备元信息列表', async () => { console.log('用电设备元信息列表'); const result = await service.loadElectricDeviceList(TestProjectId); console.log(result); expect(result).not.toBeNull(); }); test('月平均漏电流', async () => { console.log('月平均漏电流'); const result = await service.loadLeakCurrent(TestProjectId, 'b60a9591-7ba6-484e-9b6a-726ee04a227d'); console.log(result); expect(result).not.toBeNull(); }); test('月平均温度', async () => { console.log('月平均温度'); const result = await service.loadTempCurrent(TestProjectId, 'b60a9591-7ba6-484e-9b6a-726ee04a227d'); console.log(result); expect(result).not.toBeNull(); }); test('按地址获取用电设备数量', async () => { console.log('按地址获取用电设备数量'); const result = await service.loadElectricDeviceCountByAdd(TestProjectId); console.log(result); expect(result).not.toBeNull(); }); test('获取全部用电监测', async () => { const result = await service.loadPowerMonitoringOfAll(TestProjectId); console.log(result); }); test('获取按月用电监测', async () => { const result = await service.loadPowerMonitoringOfMonth(TestProjectId,'2019','7'); console.log(result); }); test('获取每月用电量-全部', async () => { const result = await service.loadElectricityList(TestProjectId); console.log(result); });