A Swift library that provides human-readable diff output for XCTAssertEqual failures and default Equatable implementations.
MirrorDiffKit is a Swift library designed to improve the testing experience by generating human-readable diff outputs when XCTAssertEqual assertions fail. It solves the problem of cryptic and unhelpful test failure messages by clearly showing what changed between two values. The library also provides default Equatable implementations for comparing types that don't conform to Equatable.
Swift developers who write unit tests with XCTest and want clearer failure messages, particularly those working with complex data structures or custom types.
Developers choose MirrorDiffKit because it dramatically reduces debugging time by presenting test failures in an intuitive diff format, and it works with any Swift type without requiring Equatable conformance.
Graduation from messy XCTAssertEqual messages.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates structured, readable diffs for any Swift type, as shown in the README with examples highlighting added and deleted keys in structs.
Provides `=~` and `!~` operators to compare types without Equatable conformance, enhancing testing flexibility for custom or third-party types.
Works directly with XCTAssertEqual by passing the diff function, replacing cryptic error messages with intuitive diff formats, as demonstrated in usage examples.
Can diff structs, classes, and nested types using Swift's Mirror API, making it versatile for complex data structures in unit tests.
Only integrates with XCTest; incompatible with other Swift testing frameworks like Quick or Nimble, limiting its use in diverse project setups.
Generating diffs for large or deeply nested objects could slow down test execution, which might be problematic in extensive or time-sensitive test suites.
The diff format is not customizable, which may not suit all needs, such as integration with custom reporting tools or specific CI/CD pipelines.