mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-01 16:12:02 +00:00
15 lines
646 B
TypeScript
15 lines
646 B
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
describe('isStoreUnavailableError', () => {
|
|
it('recognises the error from another module copy, where instanceof does not', async () => {
|
|
const first = await import('../types');
|
|
const thrown = new first.StoreUnavailableError('down');
|
|
vi.resetModules();
|
|
const second = await import('../types');
|
|
expect(thrown instanceof second.StoreUnavailableError).toBe(false);
|
|
expect(second.isStoreUnavailableError(thrown)).toBe(true);
|
|
expect(second.isStoreUnavailableError(new Error('other'))).toBe(false);
|
|
expect(second.isStoreUnavailableError(null)).toBe(false);
|
|
});
|
|
});
|