Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createHttpLink: jest.fn(() => ({ request })),
};
});
const createHttpLink = require('apollo-link-http').createHttpLink;
const LocalScopedLink = require('../batchHttpLink').BatchHttpLink;
const reduceFetchOptions = () => {};
const batch = new LocalScopedLink({
batchInterval: 20,
batchMax: 20,
reduceFetchOptions,
});
const { batchOptions } = createHttpLink.mock.calls[0][0];
expect(batchOptions.batchInterval).toBe(20);
expect(batchOptions.batchMax).toBe(20);
expect(batchOptions.reduceFetchOptions).toEqual(reduceFetchOptions);
const { request } = createHttpLink();
execute(batch, operation);
expect(request).toBeCalled();
});
});