Arthur Fiorette 92b9ed7abf
feat: more headers supports, tests and must-revalidate fix (#51)
* feat: must-revalidate and headers enum
* test: added more tests
* test: test and code fixes
* test: more tests
2021-11-11 14:16:37 -03:00

22 lines
654 B
TypeScript

import Axios from 'axios';
import { createCache, useCache } from '../../src/cache/create';
describe('tests header interpreter', () => {
it('tests argument composition', () => {
const empty = createCache();
expect(empty).not.toBeUndefined();
const axios = Axios.create();
const withAxios = useCache(axios);
expect(withAxios).not.toBeUndefined();
const withDefaults = createCache({
axios: { baseURL: 'base-url' },
cache: { ttl: 1234 }
});
expect(withDefaults).not.toBeUndefined();
expect(withDefaults.defaults.cache.ttl).toBe(1234);
expect(withDefaults.defaults.baseURL).toBe('base-url');
});
});