Skip to content

Releases: Matejkob/swift-spyable

0.4.0

05 Mar 19:33
76717f8
Compare
Choose a tag to compare

What's Changed

  • Allow swift-syntax to target 5.10.0 in #88

Full Changelog: 0.3.0...0.4.0

v0.3.0

06 Feb 21:25
Compare
Choose a tag to compare

What's Changed

  • Fix #35 - Support nonescaping closure parameters by @dafurman in #69
  • Refactor unit tests by @Matejkob in #78
  • Fix codecov badge by @Matejkob in #82
  • Fix to search for 'Spyable' in AttributeListSyntax when checking behindPreprocessorFlag. by @TTOzzi in #83
  • Update issue templates by @Matejkob in #86
  • Improve handling of behindPreprocessorFlag argument in @Spyable attribute by @Matejkob in #85

New Contributors

Full Changelog: 0.2.1...0.3.0

v0.2.1

31 Dec 18:54
Compare
Choose a tag to compare

What's Changed

  • Emit (any Error)? instead of Error? by @arennow in #70
  • Improve Closure Factory unit tests by @Matejkob in #75
  • Add handling inout parameter by @Matejkob in #76
  • Fix leading spacing on property and function declaration expansion by @dafurman in #49
  • Refactor most of the unit tests by @Matejkob in #77

New Contributors

Full Changelog: 0.2.0...0.2.1

v0.2.0

22 Nov 08:13
Compare
Choose a tag to compare

What's New in Version 0.2.0

Features

  • Restricting Spyable Usage
    • Introducing the ability to limit the usage of Spyable's generated code to specific targets, addressing the concern of unwanted use in production code.
    • You can now use the behindPreprocessorFlag parameter in the @Spyable annotation to wrap the macro expansion in a preprocessor macro, such as #if DEBUG, restricting its use where the specified flag is not defined.
      @Spyable(behindPreprocessorFlag: "DEBUG")
      protocol MyService {
          func fetchData() async
      }
      Example generated code:
      #if DEBUG
      class MyServiceSpy: MyService {
          // ... spy implementation
      }
      #endif
    • This provides more control over where Spyable's generated code can be used, allowing you to, for instance, limit it to test targets only.

Bug Fixes

  • Deprecation Warnings
    • Fixed deprecation warnings contributed by @dafurman.
    • Other various fixes and refactorings to enhance code quality.

New Contributors

For a detailed list of changes, please check the Full Changelog.

v0.1.3

19 Oct 12:17
1b30cec
Compare
Choose a tag to compare

Infrastructure update.

v0.1.2

03 Oct 17:01
8f78f36
Compare
Choose a tag to compare

New Contributors

Full Changelog: 0.1.1...0.1.2

v0.1.1

16 Jun 21:36
bbfda75
Compare
Choose a tag to compare

Update community standards; add documentation on Swift Package Index

v0.1.0

14 Jun 14:29
06eab69
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

Key Features:

  • Automatic Spy Generation: Annotate your protocol with @Spyable, and the macro will automatically generate a corresponding spy class that implements the protocol.
  • Interaction Tracking: The generated spy class can record all interactions with its methods and properties, providing a comprehensive log for precise assertions in your tests.

Migration from Sourcery:

To facilitate a smooth transition from Sourcery's Mocks & Stubs to Spyable, the initial version of Spyable generates spies for protocols in line with the AutoMockable template. This should allow most projects using Sourcery with the basic AutoMockable template to switch over to Spyable within minutes.

Full Changelog: https://github.com/Matejkob/swift-spyable/commits/0.1.0