support expect on mock catalog service methods

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-10-10 12:03:26 +02:00
parent 6cdbca351c
commit e836b774d5
10 changed files with 144 additions and 179 deletions
@@ -59,7 +59,8 @@ describe('CachedEntityLoader', () => {
});
it('returns entities from cache', async () => {
const catalog = catalogServiceMock.mock();
const catalog = catalogServiceMock();
jest.spyOn(catalog, 'getEntityByRef');
cache.get.mockResolvedValue(entity);
const loader = new CachedEntityLoader({ catalog, cache });