初始化提交

This commit is contained in:
chenxin committed 2026-08-21 16:00:13 +08:00
commit 887c1f449e
963 files changed
+166869

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
/**
* Vitest 全局 setup:注册 @testing-library/jest-dom 的 DOM 断言 matcher
*(toBeInTheDocument / toBeDisabled 等),供组件测试使用。
*/
import "@testing-library/jest-dom/vitest";
/* jsdom 缺少的 DOM API polyfill */
if (typeof ResizeObserver === "undefined") {
class ResizeObserverStub {
observe() {}
unobserve() {}
disconnect() {}
}
Object.assign(globalThis, { ResizeObserver: ResizeObserverStub });
}
if (typeof Element.prototype.scrollIntoView === "undefined") {
Element.prototype.scrollIntoView = () => {};
}