Add comprehensive test coverage for ObjectStack spec protocols - 100% coverage achieved - #65
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
…nse, webhook, translation, discovery Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
@copilot 继续 |
…eport, page, api, datasource, contract Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Completed! ✅ Test Coverage Summary:
Files Added:
Commit: 9e8678f |
…ate internals Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
| }); | ||
|
|
||
| it('should handle hierarchical territories', () => { | ||
| const parent = TerritorySchema.parse({ |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 months ago
To fix the unused variable warning without changing functionality, keep the call to TerritorySchema.parse that initializes the parent territory, but stop assigning its result to a named local variable that is never used.
Concretely, in packages/spec/src/system/territory.test.ts within the "should handle hierarchical territories" test, replace:
const parent = TerritorySchema.parse({ ... });with a statement that just calls TerritorySchema.parse and ignores the result:
TerritorySchema.parse({ ... });This preserves any side effects or validations triggered by parsing the parent territory while removing the unused variable parent. No new imports, methods, or other definitions are needed.
| @@ -263,7 +263,7 @@ | ||
| }); | ||
|
|
||
| it('should handle hierarchical territories', () => { | ||
| const parent = TerritorySchema.parse({ | ||
| TerritorySchema.parse({ | ||
| name: 'americas', | ||
| label: 'Americas', | ||
| modelId: 'fy2024', |
…be does not
`check:duration-unit-keys` read a key's unit from `.describe()` and
`.meta({ description })` only. A duration-shaped `z.number()` whose unit was
stated solely in the JSDoc block above it was a census row with `[prose: -]`
and no verdict — and the blindness did not merely miss such keys, it produced
confident wrong prose about why they were missed.
Ruled 2026-09-07 (decision batch #65): JSDoc is developer commentary, not
governed prose, so the gate does NOT start reading it as a unit channel. What
it refuses is the DIVERGENCE — JSDoc names a unit, describe names none (or
there is no describe at all) — as `unit-in-jsdoc-not-in-describe`. The JSDoc is
read in one direction only: to refuse, never to satisfy. A key with no unit in
either channel stays listed and not judged, unchanged.
The self-test pins the three measured sites as positive controls, a
unit-in-both-channels key as the negative control, and the two ways the reader
could over-fire: a `//` line comment is not a JSDoc block, and an enclosing
declaration's JSDoc is not inherited by the first property inside it.
Also repairs the two remaining imprecise recorded reasons this blindness
produced, both comment-only: the retired-key entry for
`SandboxConfig:process.timeout` and the burn-rate `window` pin comment in
`metrics.test.ts` both said "outside the gate's population" where the truth is
"inside the census, outside the verdict", and both now name the unpublished
JSDoc unit. `registry.ts` regenerated to mirror the entry.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
Sprint 3-4: Test Coverage & Platform Features ✅
Goal: Reach 80% test coverage and add critical business features
🎯 Final Results
Coverage Achieved:
Progress Checklist
Week 5-6: Test Coverage Blitz
Day 1-2: Low-Coverage Data Protocols
dataset.zod.ts: Add 15+ tests (18 tests added - 100% coverage) ✅mapping.zod.ts: Add 15+ tests (30 tests added - 100% coverage) ✅Day 3-4: Low-Coverage System Protocols
policy.zod.ts: Add 20+ tests (29 tests added - 100% coverage) ✅territory.zod.ts: Add 15+ tests (25 tests added - 100% coverage) ✅license.zod.ts: Add 15+ tests (35 tests added - 100% coverage) ✅webhook.zod.ts: Add 20+ tests (31 tests added - 100% coverage) ✅translation.zod.ts: Add 15+ tests (18 tests added - 100% coverage) ✅discovery.zod.ts: Add 20+ tests (21 tests added - 100% coverage) ✅Day 5-7: Medium-Coverage Enhancement
filter.zod.ts: Add 10+ tests to reach 90% (10 tests added - 100% coverage) ✅sharing.zod.ts: Add 15+ tests (24 tests added - 100% coverage) ✅action.zod.ts: Already at 100% coverage ✓report.zod.ts: Add 20+ tests (29 tests added - 100% coverage) ✅page.zod.ts: Add 15+ tests (23 tests added - 100% coverage) ✅api.zod.ts: Add 20+ tests (29 tests added - 100% coverage) ✅datasource.zod.ts: Add 20+ tests (27 tests added - 100% coverage) ✅agent.zod.ts: Already at 100% coverage ✓contract.zod.ts: Add 20+ tests (35 tests added - 100% coverage) ✅Day 8-10: Edge Cases & Error Handling
📊 Test Distribution
📝 Test Coverage Strategy
Each test file follows a comprehensive testing approach:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.