From 4c8ca3ab2f3b8cda337a6c03601e9d5ad7e9bacb Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Sun, 7 Jun 2026 12:27:22 +0200 Subject: [PATCH] fix(02-01): add explicit vi import to 7 test scaffold files for TypeScript compatibility vi.mock() is vitest-hoisted at runtime but TypeScript requires explicit import. Adds: import { vi } from "vitest" to all 7 new test scaffolds. npx tsc --noEmit now exits 0. --- src/__tests__/blocks.test.ts | 2 +- src/__tests__/feed.test.ts | 2 +- src/__tests__/follows.test.ts | 2 +- src/__tests__/milestones.test.ts | 2 +- src/__tests__/posts.test.ts | 2 +- src/__tests__/reports.test.ts | 2 +- src/__tests__/stories.test.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/__tests__/blocks.test.ts b/src/__tests__/blocks.test.ts index dc6a592..87db758 100644 --- a/src/__tests__/blocks.test.ts +++ b/src/__tests__/blocks.test.ts @@ -8,7 +8,7 @@ * All tests are it.todo stubs until Wave 1 implementation. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({})); diff --git a/src/__tests__/feed.test.ts b/src/__tests__/feed.test.ts index de9b66a..5aa2b91 100644 --- a/src/__tests__/feed.test.ts +++ b/src/__tests__/feed.test.ts @@ -10,7 +10,7 @@ * All tests are it.todo stubs until Wave 1 implementation. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({})); diff --git a/src/__tests__/follows.test.ts b/src/__tests__/follows.test.ts index 29d420f..5c9214a 100644 --- a/src/__tests__/follows.test.ts +++ b/src/__tests__/follows.test.ts @@ -10,7 +10,7 @@ * All tests are it.todo stubs until Wave 1 implementation. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({})); diff --git a/src/__tests__/milestones.test.ts b/src/__tests__/milestones.test.ts index 8f6b1be..2ca6fa6 100644 --- a/src/__tests__/milestones.test.ts +++ b/src/__tests__/milestones.test.ts @@ -8,7 +8,7 @@ * All tests are it.todo stubs until Wave 1 implementation. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({})); diff --git a/src/__tests__/posts.test.ts b/src/__tests__/posts.test.ts index 3c65da1..c92158c 100644 --- a/src/__tests__/posts.test.ts +++ b/src/__tests__/posts.test.ts @@ -12,7 +12,7 @@ * No real DB or Redis calls — all mocked. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({})); diff --git a/src/__tests__/reports.test.ts b/src/__tests__/reports.test.ts index 97a5e80..1dd3133 100644 --- a/src/__tests__/reports.test.ts +++ b/src/__tests__/reports.test.ts @@ -8,7 +8,7 @@ * All tests are it.todo stubs until Wave 1 implementation. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({})); diff --git a/src/__tests__/stories.test.ts b/src/__tests__/stories.test.ts index 5e992da..05aa141 100644 --- a/src/__tests__/stories.test.ts +++ b/src/__tests__/stories.test.ts @@ -10,7 +10,7 @@ * All tests are it.todo stubs until Wave 1 implementation. */ -import { describe, it } from "vitest"; +import { describe, it, vi } from "vitest"; // Mock server-only guard vi.mock("server-only", () => ({}));