feat(features): add test factories to all 5 features
Adds src/__factories__/<entity>.factory.ts to auth, blog, marketing-pages, navigation, media. Each factory uses defineFactory from @repo/core-testing with stable date defaults (2026-01-01) so snapshot diffs reflect SUT behavior only. Refactors mechanical inline-fixture tests to use factories. Also adds vitest.config.ts and tsconfig path alias to @repo/media (lacked both), and adds @repo/core-testing devDependency to @repo/media. Spec: §5.1, §6.3
This commit is contained in:
8
packages/auth/src/__factories__/session.factory.ts
Normal file
8
packages/auth/src/__factories__/session.factory.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { defineFactory } from "@repo/core-testing/factory";
|
||||
import type { Session } from "../entities/session.js";
|
||||
|
||||
export const sessionFactory = defineFactory<Session>(({ sequence }) => ({
|
||||
id: `session-${sequence}`,
|
||||
userId: "user-1",
|
||||
expiresAt: new Date("2026-12-31T23:59:59Z"),
|
||||
}));
|
||||
Reference in New Issue
Block a user