mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
style: apply prettier across the tree
One-shot prettier pass so the new format:check gate starts from a clean baseline. Formatting only — no behaviour change. Generator-owned and vendored artifacts stay untouched via .prettierignore.
This commit is contained in:
1 parent
b3fea2ef59
commit
1f4ba5939d
1000 files changed
+12130
-8385
No files matched your search
@@ -33,7 +33,7 @@ vi.mock("@/lib/db", () => ({
|
||||
// calls land on the same vi.fn instances.
|
||||
if (typeof fn === "function") {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (fn as any)((prisma as unknown as { workout: unknown }));
|
||||
return (fn as any)(prisma as unknown as { workout: unknown });
|
||||
}
|
||||
}),
|
||||
},
|
||||
@@ -103,7 +103,10 @@ function makeRequest(
|
||||
});
|
||||
}
|
||||
|
||||
function validWorkout(externalId: string, overrides: Record<string, unknown> = {}) {
|
||||
function validWorkout(
|
||||
externalId: string,
|
||||
overrides: Record<string, unknown> = {},
|
||||
) {
|
||||
return {
|
||||
sportType: "running",
|
||||
startedAt: "2026-05-14T06:30:00.000Z",
|
||||
@@ -583,9 +586,7 @@ describe("POST /api/workouts/batch — PR detection enqueue (v1.4.25 W16c)", ()
|
||||
});
|
||||
|
||||
it("propagates silent=true when the batch exceeds the historical threshold", async () => {
|
||||
const big = Array.from({ length: 51 }, (_, i) =>
|
||||
validWorkout(`uuid-${i}`),
|
||||
);
|
||||
const big = Array.from({ length: 51 }, (_, i) => validWorkout(`uuid-${i}`));
|
||||
vi.mocked(prisma.workout.createMany).mockResolvedValue({ count: 51 });
|
||||
const res = await POST(makeRequest({ workouts: big }));
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
@@ -173,9 +173,7 @@ describe("GET /api/workouts — canonical dedup", () => {
|
||||
// This test pins that the route passes `userId: user-1` so the
|
||||
// database layer drops other users' rows before the picker runs.
|
||||
const apple = makeRow("w-apple", "APPLE_HEALTH", "2026-05-15T07:00:00Z");
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([
|
||||
apple,
|
||||
] as never);
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([apple] as never);
|
||||
|
||||
await GET(makeRequest());
|
||||
|
||||
@@ -230,9 +228,7 @@ describe("GET /api/workouts — canonical dedup", () => {
|
||||
|
||||
it("exposes iOS-contract field names on each workout row", async () => {
|
||||
const apple = makeRow("w-apple", "APPLE_HEALTH", "2026-05-15T07:00:00Z");
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([
|
||||
apple,
|
||||
] as never);
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([apple] as never);
|
||||
|
||||
const res = await GET(makeRequest());
|
||||
const body = await res.json();
|
||||
|
||||
@@ -115,7 +115,12 @@ describe("GET /api/workouts/{id}", () => {
|
||||
BASE_ROW as never,
|
||||
);
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([
|
||||
{ id: "w-1", source: "APPLE_HEALTH", startedAt: BASE_ROW.startedAt, sportType: "RUNNING" },
|
||||
{
|
||||
id: "w-1",
|
||||
source: "APPLE_HEALTH",
|
||||
startedAt: BASE_ROW.startedAt,
|
||||
sportType: "RUNNING",
|
||||
},
|
||||
] as never);
|
||||
|
||||
const res = await GET(makeRequest(), makeParams("w-1"));
|
||||
@@ -181,8 +186,18 @@ describe("GET /api/workouts/{id}", () => {
|
||||
withingsRow as never,
|
||||
);
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([
|
||||
{ id: "w-apple", source: "APPLE_HEALTH", startedAt: BASE_ROW.startedAt, sportType: "RUNNING" },
|
||||
{ id: "w-withings", source: "WITHINGS", startedAt: BASE_ROW.startedAt, sportType: "RUNNING" },
|
||||
{
|
||||
id: "w-apple",
|
||||
source: "APPLE_HEALTH",
|
||||
startedAt: BASE_ROW.startedAt,
|
||||
sportType: "RUNNING",
|
||||
},
|
||||
{
|
||||
id: "w-withings",
|
||||
source: "WITHINGS",
|
||||
startedAt: BASE_ROW.startedAt,
|
||||
sportType: "RUNNING",
|
||||
},
|
||||
] as never);
|
||||
|
||||
const res = await GET(makeRequest(), makeParams("w-withings"));
|
||||
@@ -211,7 +226,12 @@ describe("GET /api/workouts/{id}", () => {
|
||||
},
|
||||
} as never);
|
||||
vi.mocked(prisma.workout.findMany).mockResolvedValueOnce([
|
||||
{ id: "w-1", source: "APPLE_HEALTH", startedAt: BASE_ROW.startedAt, sportType: "RUNNING" },
|
||||
{
|
||||
id: "w-1",
|
||||
source: "APPLE_HEALTH",
|
||||
startedAt: BASE_ROW.startedAt,
|
||||
sportType: "RUNNING",
|
||||
},
|
||||
] as never);
|
||||
|
||||
const res = await GET(makeRequest(), makeParams("w-1"));
|
||||
|
||||
Reference in new issue
Block a user