feat(features): contract suites for all repository interfaces
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
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
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([]));
|
||||
});
|
||||
Reference in New Issue
Block a user