Skip to content

0.1.0

Choose a tag to compare

@Kaeldehta Kaeldehta released this 16 Jun 22:21
· 4 commits to main since this release

First release of swift-fixture — a macro for generating fixture data in tests.

Added

  • @Fixture macro that synthesizes a static func fixture(...) factory with a default for every stored property (override only what a test needs), and also synthesizes the type's Fixture conformance so nested @Fixture types compose automatically. Works on structs and enums.
  • @FixtureCase to mark which enum case static var fixture should use, overriding the default of the first declared case.
  • @FixtureValue(_:) to override the default value @Fixture uses for an individual stored property.
  • Fixture protocol with built-in conformances for common standard-library and Foundation types.
  • Opt-in package traits for first-class fixtures of external types: Tagged (pointfree's swift-tagged) and IdentifiedCollections (pointfree's swift-identified-collections IdentifiedArray).
  • DocC documentation, published on the Swift Package Index.