refactor: bundle does not export everything that index has

This commit is contained in:
arthurfiorette 2021-12-09 14:37:21 -03:00
parent 1a5fdf9bc1
commit 488cd49527
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,6 @@
/** Index file for webpack and cdn usage */
export * from './index';
export * from './cache/create';
export * from './storage/browser';
export * from './storage/memory';
export * from './storage/storage';

15
test/bundle.test.ts Normal file
View File

@ -0,0 +1,15 @@
import { useCache } from '../src/cache/create';
import { BrowserAxiosStorage } from '../src/storage/browser';
import { MemoryAxiosStorage } from '../src/storage/memory';
import { AxiosStorage } from '../src/storage/storage';
describe('test bundle imports', () => {
it('should have basic storages', async () => {
const bundle = await import('../src/index.bundle');
expect(bundle.useCache).toBe(useCache);
expect(bundle.AxiosStorage).toBe(AxiosStorage);
expect(bundle.BrowserAxiosStorage).toBe(BrowserAxiosStorage);
expect(bundle.MemoryAxiosStorage).toBe(MemoryAxiosStorage);
});
});