Update test format (#821)
* Lint tests, format JSON * Update test formatting --------- Co-authored-by: philon- <philon-@users.noreply.github.com>
This commit is contained in:
co-authored by
philon-
parent
ee131c3681
commit
90cf136b8c
@@ -18,7 +18,7 @@ const mockSendAdminMessage = vi.fn();
|
||||
|
||||
vi.mock("@core/stores", () => ({
|
||||
CurrentDeviceContext: {
|
||||
_currentValue: { deviceId: 1234 },
|
||||
_currentValue: { deviceId: 1234 },
|
||||
},
|
||||
useNodeDB: () => ({
|
||||
updateFavorite: mockUpdateFavorite,
|
||||
|
||||
@@ -17,8 +17,8 @@ const mockToast = vi.fn();
|
||||
const mockSendAdminMessage = vi.fn();
|
||||
|
||||
vi.mock("@core/stores", () => ({
|
||||
CurrentDeviceContext: {
|
||||
_currentValue: { deviceId: 1234 },
|
||||
CurrentDeviceContext: {
|
||||
_currentValue: { deviceId: 1234 },
|
||||
},
|
||||
useNodeDB: () => ({
|
||||
updateIgnore: mockUpdateIgnore,
|
||||
|
||||
@@ -28,7 +28,7 @@ describe("useToast", () => {
|
||||
vi.runAllTimers();
|
||||
});
|
||||
|
||||
const toast = result.current.toasts[0];
|
||||
const toast = result.current.toasts[0]!;
|
||||
expect(result.current.toasts.length).toBe(1);
|
||||
expect(toast.title).toBe("Backup Reminder");
|
||||
expect(toast.description).toBe("Don't forget to backup!");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import * as idb from "idb-keyval";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createStorage } from "./indexDB";
|
||||
|
||||
type PersistStorage<T> = ReturnType<typeof createStorage<T>>;
|
||||
@@ -109,7 +109,7 @@ describe("indexDB.ts persistence (steps 1–5)", () => {
|
||||
const out = await roundTrip({ state: { m }, version: 0 });
|
||||
const m2 = out!.state.m as Map<number, { key: Uint8Array }>;
|
||||
expect(m2 instanceof Map).toBe(true);
|
||||
|
||||
|
||||
const got = m2.get(42)!;
|
||||
expect(got.key instanceof Uint8Array).toBe(true);
|
||||
expect(Array.from(got.key)).toEqual([7, 8]);
|
||||
@@ -155,4 +155,4 @@ describe("indexDB.ts persistence (steps 1–5)", () => {
|
||||
expect(m2 instanceof Map).toBe(true);
|
||||
expect(m2.get(1)).toBe("x");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user