初始化提交
This commit is contained in:
commit
887c1f449e
963 files changed
+166869
No files matched your search
@@ -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 = () => {};
|
||||
}
|
||||
Reference in new issue
Block a user