Feat/refactor - #179
Merged
Merged
Conversation
修复测试正确性问题并消除对 dist 构建产物的硬依赖: - 修复 test-router.ts 中 Koa/@leizm/web 假测试(原用 express.Router 冒充), 改为真实 koa-router 与 @leizm/web Router 验证路由结构 - 新增 test-integration-koa.ts:真实 Koa + koa-router + koa-bodyparser 集成测试,覆盖 bind() 的 forceGroup 与非 forceGroup 两种模式 - 新增 test-integration-leizmweb.ts:真实 @leizm/web Application + Router 集成测试,覆盖 bind() 两种模式与 component.bodyParser 接入 - 修复 test-params.ts/test-lib.ts 对 dist 的硬依赖(6 处 require 改为 src import),test:lib 现可在干净仓库独立运行 - 适配器覆盖率:koa.ts 40%→95%,leizmweb.ts 45%→100%,error.ts 51%→100% 测试总数 591→609,整体覆盖率 91.49%→94%
- 重写「快速开始」,提供三框架(Express/Koa/@leizm/web)通用的 API 定义 - 新增「框架接入指南」章节,每个框架提供完整可运行示例: - Express:含 json/urlencoded 解析、错误处理中间件 - Koa:含 koa-bodyparser 接入、koa-router、统一错误处理、handler 写法 - @leizm/web:含 component.bodyParser 接入、ctx.request.$params 用法 - 三框架均覆盖 forceGroup 与非 forceGroup 两种模式 - 补充测试脚手架、分组中间件、错误处理(ERestError)等高级用法 - 移除过时的 generator-erest 脚手架引用(面向 v1,已 5 年未更新) - 修复 node 版本徽章(≥18)与拼写问题
- CI workflow 合并重复的测试步骤:移除冗余的 test:lib, 统一由 test:cov(带覆盖率)执行,测试时间减半 - coverage 上传步骤改用 if 条件控制,仅在 Node 20 矩阵执行 - package.json 简化 test:cov 为直接命令,去掉经由 test:lib 的间接调用
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.