Fix tests

firmware_quickfix
Rick Carlino 2020-01-28 11:05:48 -06:00
parent 9ccb0fab68
commit f0eadf2c98
2 changed files with 5 additions and 3 deletions

View File

@ -14,10 +14,12 @@ const mockDeviceDefault: DeepPartial<Farmbot> = {
home: jest.fn(() => Promise.resolve()),
sync: jest.fn(() => Promise.resolve()),
readStatus: jest.fn(() => Promise.resolve()),
dumpInfo: jest.fn(() => Promise.resolve()),
dumpInfo: jest.fn(() => Promise.resolve())
};
const mockDevice = { current: mockDeviceDefault };
const mockDevice = {
current: mockDeviceDefault
};
jest.mock("../../device", () => ({ getDevice: () => mockDevice.current }));

View File

@ -97,7 +97,7 @@ export function reboot() {
export function restartFirmware() {
const noun = t("Restart Firmware");
const device = getDevice();
device
return device
.rebootFirmware()
.then(device.emergencyLock)
.then(device.emergencyUnlock)