UNPKG

@thoughtspot/visual-embed-sdk

Version:
20 lines (18 loc) 592 B
import 'jest-fetch-mock'; import { getSourceDetail } from './sourceService'; describe('Source service tests', () => { test('Should return source detail and cache it', async () => { fetchMock.mockResponseOnce(JSON.stringify({ data: { getSourceDetail: [{ Bla: { id: {}, }, }], }, })); await getSourceDetail('https://tshost', 'id'); await getSourceDetail('https://tshost', 'id'); expect(fetchMock).toBeCalledTimes(1); }); });