Skip to content

Commit

Permalink
refactor: bundle does not export everything that index has
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Dec 9, 2021
1 parent 1a5fdf9 commit 488cd49
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.bundle.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions test/bundle.test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});

0 comments on commit 488cd49

Please sign in to comment.