Each repository interface now has a contract suite under
src/__contracts__/. Both Mock and Payload implementations run the
same suite, eliminating mock-vs-real drift. Payload impls back the
contract with an in-memory stub via vi.mock('payload') + a small
buildPayloadStub helper.
Spec: §5.2, §6.4
9 lines
392 B
TypeScript
9 lines
392 B
TypeScript
import { describe } from "vitest";
|
|
import { MockUsersRepository } from "@/infrastructure/repositories/mock-users.repository";
|
|
import { usersRepositoryContract } from "@/__contracts__/users-repository.contract";
|
|
|
|
describe("MockUsersRepository", () => {
|
|
// Start with empty store so contract tests run from a clean slate.
|
|
usersRepositoryContract.run(() => new MockUsersRepository([]));
|
|
});
|