import type { Container } from "inversify" ; import { instance , mock } from "ts-mockito" ; type Class < T > = new ( ... args ) => T ; export const bindMock = < T > ( container , identifier , clazz ) : T => { const clazzMock = mock < T > ( clazz ) ; container . rebind ( identifier ) . toConstantValue ( instance ( clazzMock ) ) ; return clazzMock ; } ;