Skip to content

Commit

Permalink
test: added #317 test
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Aug 18, 2022
1 parent 288baa8 commit 491fb01
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/interceptors/response.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,21 @@ describe('test request interceptor', () => {
expect(headers[Header.XAxiosCacheLastModified]).not.toBe(headerValue);
expect(headers[Header.XAxiosCacheStaleIfError]).not.toBe(headerValue);
});

// https://github.com/arthurfiorette/axios-cache-interceptor/issues/317
// it('Expects that aborted requests clears its cache', async () => {
// const id = 'abort-request-id';
// const { signal, abort } = new AbortController();
// const axios = mockAxios();
//
// const promise = axios.get('url', { id, signal });
//
// abort();
//
// await expect(promise).rejects.toThrow(Error);
//
// const cache = await axios.storage.get(id);
// expect(cache.state).not.toBe('loading');
// expect(cache.state).toBe('empty');
// });
});

0 comments on commit 491fb01

Please sign in to comment.