Skip to content

test(odetovibe/load): cover 6 Load domain test gaps#67

Open
scorpevans wants to merge 7 commits intomainfrom
test/20260304-2111-odetovibe-load-gaps
Open

test(odetovibe/load): cover 6 Load domain test gaps#67
scorpevans wants to merge 7 commits intomainfrom
test/20260304-2111-odetovibe-load-gaps

Conversation

@scorpevans
Copy link
Owner

Summary

Covers the 6 Load domain test gaps identified in the gap analysis. Each gap is a separate commit.

  • Gap 1 — Prettier applied in merge and strict modes: confirms formatCode runs on both the new-file fallback path and the existing-file merge path for MergeWriter and StrictMergeWriter
  • Gap 2StrictMergeWriter conflict on import type-only change: adds import-level conflict detection to hasConflict — when codegen changes an import from import type { Foo } to import { Foo } (or vice versa), strict mode now writes to .ode.ts instead of silently leaving both coexisting after merge
  • Gap 3MergeWriter with generated interface properties: documents the ownership contract — existing interfaces are user-owned; generated properties are silently dropped even when the stub has new fields
  • Gap 4writeFiles orchestration in merge and strict modes: two orchestration-level tests that exercise the full writeFiles call with "merge" and "strict" context
  • Gap 5compileErrors field on WriteResult: verifies that the field is populated (and the file NOT written) when generated content contains undeclared names (TS2304)
  • Gap 6.ode.ts path for multi-dot filenames: confirms .ode is inserted before the last extension (access-building.test.tsaccess-building.test.ode.ts, not access-building.ode.test.ts)

Test plan

  • pnpm --filter odetovibe test src/load/index.test.ts — 58 tests pass (was 44)
  • Gap 2 includes a source change to write-file.ts (hasConflict) — verified by the new test

🤖 Generated with Claude Code

Evans Akai Bekoe and others added 7 commits March 4, 2026 21:24
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nly conflicts

Adds import-level conflict detection to hasConflict: when a generated
import declaration changes type-only status relative to the existing
file (e.g. "import type { Foo }" → "import { Foo }"), StrictMergeWriter
now writes to .ode.ts rather than silently leaving both declarations
coexisting after merge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…roperties

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…trict modes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-check fails

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…for multi-dot names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scorpevans
Copy link
Owner Author

Reviewed. Checked: (1) hasConflict import detection logic is correct — matches on specifier + namespace status, returns true only when isTypeOnly differs; (2) compileErrors test reliably produces TS2304 via the isolated fallback project (no tsconfig in tmpdir); (3) multi-dot conflict path test verifies path.extname behavior; (4) interface properties drop test correctly documents the ownership contract; (5) writeFiles merge/strict tests exercise the full orchestration path; (6) all 58 tests pass. Source change in write-file.ts is minimal and well-scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant