Release v1.4.0 (#11)

* refactor websocket / power usage

* cooldown between api requests during testing

* refactor power state methods

* remove unused code

* cooldown between api requests during testing

* version bump
This commit is contained in:
Martin M
2019-08-19 23:05:52 -03:00
committed by GitHub
parent 420d6746a6
commit 171faa617b
16 changed files with 217 additions and 182 deletions

View File

@@ -10,6 +10,10 @@ const {
const { loginExpectations } = require('./_setup/expectations');
describe('valid credentials, invalid device', () => {
beforeEach(async () => {
await delay(1000);
});
test('get device power state should fail', async () => {
const conn = new ewelink({ email, password });
const powerState = await conn.getDevicePowerState('invalid deviceid');
@@ -54,7 +58,6 @@ describe('valid credentials, invalid device', () => {
test('raw power on device without electricity monitor should fail', async () => {
jest.setTimeout(30000);
await delay(1000);
const conn = new ewelink({ email, password });
const powerUsage = await conn.getDeviceRawPowerUsage(deviceIdWithoutPower);
expect(typeof powerUsage).toBe('object');