test: add comprehensive automated test coverage
- Vitest multi-project setup (unit / integration / component) - Real-Postgres integration harness via in-process PGlite (TEST_DATABASE_URL override), migrations applied per worker; production code untouched - Unit: routing, locale, validation/Zod schemas, metadata, mail, site-theme, marquee, media, portfolio helpers, plus architecture-rule tests - Integration: Prisma data layer, API routes, and all server actions - Component: UI primitives and form components (jsdom + Testing Library) - 371 tests passing
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
resolveMediaUploadPath,
|
||||
sanitizeBaseName,
|
||||
} from "../lib/media-storage";
|
||||
import { canManageUploads } from "./helpers/fs-capability";
|
||||
|
||||
const createdFiles: string[] = [];
|
||||
|
||||
@@ -39,7 +40,7 @@ describe("media storage helpers", () => {
|
||||
expect(resolvedPath.endsWith(path.join("assets", "test.svg"))).toBe(true);
|
||||
});
|
||||
|
||||
it("removes a managed file from disk", async () => {
|
||||
it.skipIf(!canManageUploads)("removes a managed file from disk", async () => {
|
||||
const relativePath = `/uploads/media/tests/${Date.now()}-temp.txt`;
|
||||
const absolutePath = resolveMediaUploadPath(relativePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user