All Versions
25
Latest Version
Avg Release Cycle
17 days
Latest Release
416 days ago

Changelog History
Page 1

  • v0.16.0 Changes

    October 08, 2020

    Targets

    • Xcode 12.0 / Swift 5.3
    • 🍎 iOS 8.0+, macOS 10.14+, tvOS 9.0+

    Migrating from 0.15

    Thunk Pruning

    The generator flag --disable-thunk-stubs has been replaced with the option --prune [disable|stub|omit]. Specify disable for the thunk pruning method to reproduce the previous flag behavior.

    Level Description
    βœ… disable
    stub Generate partial definitions filled with fatalError.
    omit Don’t generate any definitions for unused types.

    πŸ†• New Features

    ✨ Enhancements

    • πŸ‘Œ Improved support for Xcode 12 / Swift 5.3 and upgraded all dependency versions (#168)
      Andrew Chang
    • πŸ‘Œ Improved handling of module names shadowed by top level nominal types (#172)
      Andrew Chang
  • v0.15.0 Changes

    August 13, 2020

    Targets

    • Xcode 11.6 / Swift 5.2
    • 🍎 iOS 8.0+, macOS 10.14+, tvOS 9.0+

    Migrating from 0.14

    🀑 Generic Mock Initialization

    πŸš€ This release unifies the mock initialization API for generic types.

    class MyClass {}protocol MyProtocol {}class MyGenericClass\<T\> {}protocol MyGenericProtocol { associatedtype T}// Oldmock(MyClass.self)mock(MyProtocol.self)mock(MyGenericClassMock\<Bool\>.self)mock(MyGenericProtocolMock\<Bool\>.self)// Newmock(MyClass.self) // no changemock(MyProtocol.self) // no changemock(MyGenericClass\<Bool\>.self)mock(MyGenericProtocol\<Bool\>.self)
    

    Value Provider Semantics

    Value provider has been simplified and no longer allows for hierarchical composition and decomposition.

    // Oldvar provider = ValueProvider() provider.addSubprovider(.standardProvider) provider.removeSubprovider(.standardProvider)// New (mutating)var provider = ValueProvider() provider.add(.standardProvider)// New (non-mutating)let provider = ValueProvider() + .standardProviderlet provider = ValueProvider().adding(.standardProvider)
    

    πŸ†• New Features

    ✨ Enhancements

    • ⚑️ Updated code signing certificates and added CI action to build signed artifacts on commit with audit trail (#104)
      Andrew Chang | Ryan Meisters
  • v0.14.1 Changes

    July 30, 2020

    Patch Notes

  • v0.14.0 Changes

    July 15, 2020

    Targets

    • Xcode 11.5 / Swift 5.2
    • 🍎 iOS 8.0+, macOS 10.14+, tvOS 9.0+

    Migrating from 0.13

    πŸš€ Thanks to Joe Tennant and various partners for testing this month’s 0.14 release candidate. If you’d like to help with a future release or add your project to Mockingbird’s source compatibility tests, please reach out on Slack.

    Explicit Stubbing Syntax

    πŸ“š To make the framework more accessible to all users, this release introduces an explicit stubbing syntax that uses named methods instead of global operators. Although the explicit stubbing syntax will be the default in documentation going forward, the ~> stubbing operator will continue to exist as the shorthand notation.

    The explicit stubbing syntax is a 1:1 match with the stubbing operator, so switching between the two notations is very intuitive.

    // Explicit stubbing syntaxgiven(bird.canChirp()).willReturn(true)given(bird.canChirp()).willThrow(BirdError())given(bird.canChirp(volume: any())).will { volume inreturn volume \< 42}// Shorthand stubbing operatorgiven(bird.canChirp()) ~\> truegiven(bird.canChirp()) ~\> { throw BirdError() }given(bird.canChirp(volume: any())) ~\> { volume inreturn volume \< 42}
    

    πŸš€ As part of the explicit stubbing syntax addition, this release also includes an API reference generated from HeaderDoc comments: https://birdrides.github.io/mockingbird/latest/

    Fast Compilation with Thunk Stubs

    βœ… To reduce compilation time, Mockingbird now only generates mocking code (known as thunks) for types referenced in tests with mock(SomeType.self). Types not used in any test files produce minimal generated code in the form of β€œthunk stubs,” which are simply bodies containing fatalError. Projects that indirectly synthesize mocked types, such as through Objective-C based dependency injection, may incorrectly encounter thunk stubs during tests and require special consideration.

    • Option 1: Explicitly reference each indirectly synthesized type in your tests, e.g. _ = mock(SomeType.self). References can be placed anywhere in the test target sources, such as in the setUp method of a test case or in a single file.
    • Option 2: Disable thunk stubs entirely by adding the --disable-thunk-stubs generator flag.

    πŸ†• New Features

    ✨ Enhancements

    • πŸ›  Fixed regression in recording throwing invocations (#148)
      Andrew Chang | Joe Tennant
    • πŸ‘Œ Improved missing stub implementation test failure message by including invocation stack trace and examples (#142)
      Andrew Chang
    • πŸ›  Fixed missing return type in ordering logic (#145)
      Andrew Chang
    • πŸ‘Œ Improved SPM installation instructions (#147)
      Andrew Chang
    • πŸ‘Œ Improved documentation for class mocks and unavailable mocks (#149)
      Andrew Chang
  • v0.13.1 Changes

    June 23, 2020

    Patch Notes

    • πŸ›  Fixed regression in recording invocations to throwing methods stubbed to throw errors
      Andrew Chang | Joe Tennant
  • v0.13.0 Changes

    June 09, 2020

    Targets

    • Xcode 11.4 / Swift 5.2
    • 🍎 iOS 8.0+, macOS 10.14+, tvOS 9.0+

    Migrating from 0.12

    • 🀑 Mocks for types without designated initializers and conforming to NSObjectProtocol now correctly inherit the designated initializer from NSObject and must be initialized with .initialize()

      protocol MyProtocol: NSObjectProtocol {}// Oldmock(MyProtocol.self)// Newmock(MyProtocol.self).initialize()

    πŸ†• New Features

    ✨ Enhancements

  • v0.12.2 Changes

    May 27, 2020

    Patch Notes

    • πŸ›  Fix uniqueness and equality operators for parsed type models causing issues with duplicate inherited member types
      Andrew Chang
  • v0.12.1

    May 07, 2020
  • v0.12.0 Changes

    May 07, 2020

    Targets

    • Xcode 11.4 / Swift 5.2
    • 🍎 iOS 8.0+, macOS 10.14+, tvOS 9.0+

    Migrating from 0.11

    • 🀑 Mocking class constrained protocols without designated initializers now uses protocol mocking instead of class mocking

      protocol MyProtocol: AnyObject {}// Oldmock(MyProtocol.self).initialize()// Newmock(MyProtocol.self)

    • 🚚 The convenience non-parameterized closure stubbing operator has been removed; convert implicit argument closure stubs to explicitly ignore arguments

      // Oldgiven(myMock.doSomething(with: any())) ~> { print("Ignoring arguments") }// Newgiven(myMock.doSomething(with: any())) ~> { _ in print("Ignoring arguments") }

    πŸ†• New Features

    ✨ Enhancements

    • ♻️ Refactor import and compilation directive parsing to use SwiftSyntax, resulting in faster code generation (#92)
      Andrew Chang
    • βœ… Uniquify default generated file names when using the installer by prefixing the test target name (#100)
      Andrew Chang

    πŸ› Bug Fixes

    • πŸ›  Fix compatibility with Swift 5.2 (#91)
      Andrew Chang
    • πŸ›  Fix stubbing methods without parameters by removing the non-parameterized closure stubbing operator (#86)
      Andrew Chang | seven332
    • πŸ›  Fix generating convenience initializers for class constrained protocols without a declared designated initializer
      Andrew Chang
    • πŸ›  Fix handling bash-style variables in build settings, e.g. ${TARGET_NAME} (#83)
      Andrew Chang
    • πŸ›  Fix type inference for string literals and initialized types assigned to properties in class mocks (#108)
      Andrew Chang | Ryan Meisters
    • πŸ›  Fix mocking classes with designated and synthesized initializers, e.g. from Decodable (#93)
      Andrew Chang | Tristan Diependael
    • πŸ›  Fix synchronization of collection types in CLI and framework (#106)
      Andrew Chang
    • πŸ›  Fix uninstaller not removing .generated.swift source files added by the installer (#100)
      Andrew Chang
  • v0.11.1 Changes

    April 10, 2020

    Patch Notes

    • βͺ Revert enforcing correct usage of class and protocol mock initialization which can cause type inference to fail
      Andrew Chang