Hazork 70e5c07ff3 refactor: concurreny fixes and refactored deferred
Also changed format settings,
fixed AxiosResponse types
and coded more tests
2021-09-20 12:04:40 -03:00

24 lines
566 B
TypeScript

import { axiosMock, mockAxios } from '../mocks/axios';
describe('test request interceptor', () => {
it('tests cache predicate integration', async () => {
const axios = mockAxios();
const fetch = () =>
axios.get('', {
cache: {
cachePredicate: {
responseMatch: () => false
}
}
});
// Make first request to cache it
await fetch();
const result = await fetch();
expect(result.status).toBe(axiosMock.statusCode);
expect(result.statusText).toBe(axiosMock.statusText);
});
});