fix(test): 修复测试环境问题
ci/woodpecker/push/woodpecker Pipeline failed

1. jest.setup.js:
   - 添加 Request/Response/Headers 全局对象 mock
   - 解决 'Request is not defined' 错误

2. .eslintrc.json:
   - 将 jest.setup.js 添加到忽略列表

3. shared-mocks.tsx:
   - 添加 ArrowUp 图标 mock

4. back-to-top.test.tsx:
   - 重写测试使用 import 语法
   - 使用 fireEvent.scroll 触发滚动事件
   - 修复组件渲染测试
This commit is contained in:
张翔
2026-03-29 14:50:09 +08:00
parent e0ca8235c8
commit 7cbb7a9ac8
12 changed files with 2289 additions and 20 deletions
+2 -1
View File
@@ -33,7 +33,8 @@
"node_modules/**",
"coverage/**",
"scripts/**",
"config/test/**"
"config/test/**",
"jest.setup.js"
],
"globals": {
"jest": "readonly"