Skip to content

Add comprehensive test coverage for core API classes#38

Merged
EvanBacon merged 1 commit intomainfrom
@evanbacon/test-coverage
Feb 27, 2026
Merged

Add comprehensive test coverage for core API classes#38
EvanBacon merged 1 commit intomainfrom
@evanbacon/test-coverage

Conversation

@EvanBacon
Copy link
Owner

Summary

  • Add test coverage for foundational classes that were previously untested
  • Implement round-trip testing following XcodeProj (Swift) patterns
  • Add shared test utilities for consistency across test files

New Test Files

File Coverage
test-utils.ts Shared utilities: loadFixture(), expectRoundTrip(), expectNoOrphanReferences()
AbstractObject.test.ts inflate(), toJSON(), isReferencing(), removeReference(), getReferrers()
RoundTrip.test.ts Parse → toJSON → build → parse validation for 10 fixtures
SwiftPackage.test.ts XCRemoteSwiftPackageReference, XCLocalSwiftPackageReference, XCSwiftPackageProductDependency
AbstractGroup.test.ts mkdir(), move(), createGroup(), createFile(), getChildGroups()
Xcode16Features.test.ts PBXFileSystemSynchronizedRootGroup, PBXFileSystemSynchronizedBuildFileExceptionSet

Expanded Tests

  • XcodeProject.test.ts: Added tests for getObject(), createModel(), getReferrers(), toJSON(), and Map operations

Test plan

  • All 412 tests pass (npx jest)
  • Round-trip validation for 10 different project fixtures
  • Type checking passes (bunx tsc --noEmit)

🤖 Generated with Claude Code

- AbstractObject.test.ts: Tests for inflate(), toJSON(), isReferencing(), removeReference()
- XcodeProject.test.ts: Expanded with getObject(), createModel(), getReferrers(), toJSON()
- RoundTrip.test.ts: Parse -> toJSON -> build -> parse validation for 10 fixtures
- SwiftPackage.test.ts: Tests for XCRemoteSwiftPackageReference, XCLocalSwiftPackageReference
- AbstractGroup.test.ts: Tests for mkdir(), move(), createGroup(), createFile()
- Xcode16Features.test.ts: Tests for PBXFileSystemSynchronizedRootGroup
- test-utils.ts: Shared utilities for fixtures, round-trip validation, orphan detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@EvanBacon EvanBacon force-pushed the @evanbacon/test-coverage branch from 3991089 to edd230f Compare February 27, 2026 20:16
@EvanBacon EvanBacon merged commit 941b562 into main Feb 27, 2026
1 check passed
@EvanBacon EvanBacon deleted the @evanbacon/test-coverage branch February 27, 2026 20:20
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