test(cli): e2e logs command (#161) #170
Reference in New Issue
Block a user
Delete Branch "test/161-logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #161
验证
nerve logs输出包含日志条目,支持 -n 限制行数和 --offset 翻页。e2e-logs.test.ts(6 个测试用例)e2e-harness.ts添加 logsCommand✅ Approve (minor suggestions)
6 个测试覆盖了 logs 的主要场景:missing file、tail、-n、--offset、pagination hint、empty file,不错!
建议:
⚠️ 负向断言较脆弱 —
not.toContain("log entry 1\n")依赖尾部换行避免匹配log entry 10,建议改用 regex:expect(result.stdout).not.toMatch(/log entry 1[^0-9]/)💡 harness 扩展的 daemon/status/stop 命令跟 #169 有重叠,注意合并顺序避免冲突
--follow/-f模式没测(streaming 确实难搞),记个 TODO 就行Verdict: Approve 🎉