moduleMockReplace module mocking with dependency injection through a real interface, service layer, or faithful test implementation.small-rules/no-module-mockingDisallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.
Ported from dmmulroy/anti-slop. Module mocks make tests depend on import machinery instead of a parameter the production code already takes. Use a real interface, a service layer, or an in-memory fake that behaves like the module.
moduleMockReplace module mocking with dependency injection through a real interface, service layer, or faithful test implementation.This rule does not accept options.
vi.mock('./user-store');const store = new InMemoryUserStore();