Revert "test: fix 'window is not defined'"

This reverts commit aefabffd77ea55ab04655e31c7324592b87d4014.
This commit is contained in:
Zeke Zhang 2023-12-29 12:19:19 +08:00
parent 7334e0b3fb
commit c739cff581

View File

@ -34,10 +34,6 @@ Object.defineProperty(window, 'matchMedia', {
const { getComputedStyle } = window; const { getComputedStyle } = window;
window.getComputedStyle = (elt) => getComputedStyle(elt); window.getComputedStyle = (elt) => getComputedStyle(elt);
// 解决 https://github.com/nocobase/nocobase/actions/runs/7353181446/job/20018831007?pr=3282
// 该错误是发生在测试环境之后的,应该是存在异步代码没有 await 导致的,但是不知道是哪里的问题,所以先这样处理
global.window = window;
/** /**
* TypeError: range.getBoundingClientRect is not a function * TypeError: range.getBoundingClientRect is not a function
* https://github.com/jsdom/jsdom/issues/3002 * https://github.com/jsdom/jsdom/issues/3002