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:
@@ -33,7 +33,8 @@
|
||||
"node_modules/**",
|
||||
"coverage/**",
|
||||
"scripts/**",
|
||||
"config/test/**"
|
||||
"config/test/**",
|
||||
"jest.setup.js"
|
||||
],
|
||||
"globals": {
|
||||
"jest": "readonly"
|
||||
|
||||
Reference in New Issue
Block a user