There\'s a longish discussion about how to do this in this issue.
I\'ve experimented with a number of the proposed solutions but I\'m not having much luck.
C
I also found that this worked for me:
export const mockRepository = jest.fn(() => ({ metadata: { columns: [], relations: [], }, }));
and
const module: TestingModule = await Test.createTestingModule({ providers: [{ provide: getRepositoryToken(Entity), useClass: mockRepository }], }).compile();