Skip to content

Instantly share code, notes, and snippets.

@leongaban leongaban/poolApi.test.ts
Last active Sep 18, 2018

Embed
What would you like to do?
poolTest
import LiquidityPoolApi from './LiquidityPool';
const endpoint = '/frontoffice/api/liquidity-pool/get-total-payout';
jest.mock(endpoint, () => ({
getUsersTotalPayout: jest.fn(() => Promise.resolve({ data: { payout: 100.21 } }))
}));
describe('LiquidityPool API: getUsersTotalPayout', () => {
it('should make a request when we get images', () => {
// const testApi = new LiquidityPoolApi();
expect(LiquidityPoolApi.getUsersTotalPayout).toHaveBeenCalledWith(endpoint, 'GET');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.