Skip to content

Commit

Permalink
test: added index.development tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Dec 30, 2021
1 parent 58b6b12 commit 1e251dd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,28 @@ import { MemoryAxiosStorage } from '../src/storage/memory';
import { AxiosStorage } from '../src/storage/storage';

describe('test bundle imports', () => {
it('should have basic storages', async () => {
it('tests browser ', async () => {
const bundle = await import('../src/index.browser');

expect(bundle.setupCache).toBe(setupCache);
expect(bundle.AxiosStorage).toBe(AxiosStorage);
expect(bundle.BrowserAxiosStorage).toBe(BrowserAxiosStorage);
expect(bundle.MemoryAxiosStorage).toBe(MemoryAxiosStorage);
});

it('should have basic storages', 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.AxiosStorage).toBe(AxiosStorage);
expect(bundle.BrowserAxiosStorage).toBe(BrowserAxiosStorage);
expect(bundle.MemoryAxiosStorage).toBe(MemoryAxiosStorage);

console.warn = oldWarn;
});
});

0 comments on commit 1e251dd

Please sign in to comment.