@thoughtspot/visual-embed-sdk
Version:
ThoughtSpot Embed SDK
20 lines (18 loc) • 592 B
text/typescript
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);
});
});