mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 21:11:51 +03:00
13 lines
356 B
TypeScript
13 lines
356 B
TypeScript
|
import { vi } from 'vitest';
|
||
|
|
||
|
if (typeof window !== 'undefined') {
|
||
|
// Refs: https://github.com/jsdom/jsdom/blob/master/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js
|
||
|
const customElements = {
|
||
|
define: vi.fn(),
|
||
|
get: vi.fn(),
|
||
|
whenDefined: vi.fn(),
|
||
|
upgrade: vi.fn(),
|
||
|
};
|
||
|
vi.stubGlobal('customElements', customElements);
|
||
|
}
|