axios-cache-interceptor/test/bundle.test.ts
2022-01-08 12:57:19 -03:00

21 lines
651 B
TypeScript

import { setupCache } from '../src/cache/create';
import { buildMemoryStorage } from '../src/storage/memory';
import { buildWebStorage } from '../src/storage/web-api';
describe('test bundle imports', () => {
it('test development bundle imports', async () => {
const oldWarn = console.warn;
console.warn = jest.fn();
const bundle = await import('../src/index.development');
expect(console.warn).toHaveBeenCalledTimes(1);
expect(bundle.setupCache).toBe(setupCache);
expect(bundle.buildMemoryStorage).toBe(buildMemoryStorage);
expect(bundle.buildWebStorage).toBe(buildWebStorage);
console.warn = oldWarn;
});
});