test(core): 补充单元测试,修复 useCountUp 精度问题,新增项目文档
- 新增 hooks/components/lib 共 9 个测试文件,覆盖边界条件与异常路径 - 补充 animations.test.tsx 用例(RotatingBorder、CounterWithEffect 等) - 修复 useCountUp 结束时 toFixed 精度问题 - 调整 jest 覆盖率配置为渐进式阈值,收缩收集范围 - 新增 docs/lessons-learned.md(经验教训汇总)与 docs/troubleshooting.md(问题排查索引) - 更新 README.md 文档索引
This commit is contained in:
1 parent
55381d7012
commit
38be4a19ef
15 files changed
+2907
-6
No files matched your search
@@ -48,7 +48,7 @@ export function useCountUp({
|
||||
if (progress < 1) {
|
||||
frameRef.current = requestAnimationFrame(animate);
|
||||
} else {
|
||||
setValue(end);
|
||||
setValue(Number(end.toFixed(decimals)));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user