mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-04 19:15:33 +08:00
test: fix flaky in customElements (#2109)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user