@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
24 lines (23 loc) • 568 B
text/typescript
import {
DeviceHalted,
DeviceInOSUExpected,
deserializeError,
serializeError,
} from "@ledgerhq/errors";
test("DeviceHalted", () => {
const error = new DeviceHalted();
expect(error).toBeInstanceOf(DeviceHalted);
const blob = serializeError(error);
expect(blob).toMatchObject({
name: "DeviceHalted",
});
const des = deserializeError(blob);
expect(des).toBeInstanceOf(DeviceHalted);
});
test("DeviceInOSUExpected", () => {
expect(
deserializeError({
name: "DeviceInOSUExpected",
}),
).toBeInstanceOf(DeviceInOSUExpected);
});