Skip to content

Latest commit

 

History

History
108 lines (75 loc) · 4.7 KB

CHANGELOG.md

File metadata and controls

108 lines (75 loc) · 4.7 KB

DevTesting Changelog

1.8.0: November 24, 2026

This release requires Swift 6.4 (Xcode 27) to build. There are no other changes.

1.7.0: November 13, 2026

This release makes it possible to create stubs that return a placeholder value until they’re configured, so that a test that calls an unconfigured stub fails instead of crashing.

  • The new DefaultStubValueProviding protocol lets a type provide a default value for stubs that return it. DevTesting conforms common standard library and Foundation types, including Array, Bool, Data, Date, Dictionary, floating point and integer types, Optional, Set, String, URL, and UUID.
  • Stub has a new init() that returns the default stub value until configured, available when its return type conforms to DefaultStubValueProviding.
  • ThrowingStub has a new init() for stubs whose error type is any Error. It throws an unspecified error until configured.
  • The new ArbitraryError type is an error for tests that just need an error to throw. RandomValueGenerating has a new randomError(fileID:function:) function that creates one with a random description beginning with the calling file and function. If your tests already extend RandomValueGenerating with a function named randomError, you may need to rename or remove it to avoid ambiguous calls.

1.6.0: June 16, 2026

This release moves DevTesting’s seedable random number generator and random value generation extensions into its own library, called DevRandom. This enables consumers to use random value generation outside of tests. DevTesting uses DevRandom to implement its RandomValueGenerating type, and re-exports DevRandom so that existing consumers do not need to add any import statements to existing files.

1.5.0: October 22, 2025

The Date.random(in:using:) functions now use BinaryFloatingPoint.randomPrintable(in:using:) to generate time intervals. This should lead to greater reliability when converting the time intervals of generated dates into strings.

1.4.0: October 12, 2025

Stub and ThrowingStub now conform to Observable. The only property that is tracked is calls. Changes to dependent properties like callArguments and callResults can also be tracked, but changes to resultQueue and defaultResult are not.

1.3.0: October 2, 2025

Adds functions for randomly generating dates within a specified range.

  • Date has been extended with two static functions, both spelled random(in:using:), that generate a random date in either a closed or half-open range.

  • RandomValueGenerating has been extended with a new property requirement and two new functions.

    • The new property is a ClosedRange<Date> spelled defaultClosedDateRange. This property provides a default closed date range to use when generating random dates. A default implementation is provided.
    • The two new functions, both spelled randomDate(in:), generate a random date in either a closed or half-open range using the aforementioned Date extension. The closed range version’s range parameter is optional. When nil is used (the default), defaultClosedDateRange is used.

1.2.0: September 24, 2025

This update bumps the minimum supported version of Apple’s OSes to 26.

1.1.0: September 17, 2025

Adds two initializers to ThrowingStub: init(defaultReturnValue:resultQueue:) and init(defaultError:resultQueue:). These initializers enable cleaner call sites, as in the following example:

// Before
mock.doSomethingSuccessfullyStub = ThrowingStub(defaultResult: .success(value))
mock.doSomethingUnsuccessfullyStub = ThrowingStub(defaultResult: .failure(error))

// After
mock.doSomethingSuccessfullyStub = ThrowingStub(defaultReturnValue: value)
mock.doSomethingUnsuccessfullyStub = ThrowingStub(defaultError: error)

1.0.0: September 1, 2025

This is the first release of DevTesting. The initial feature set includes

  • SeedableRandomNumberGenerator, a random number generator that can be seeded to enable repeatable tests with random data.
  • RandomValueGenerating, a protocol that your test suite can conform to to add random value generation. It uses a seedable random number generator, and logs the seed before every test so that you can debug tests that failed. It also includes convenient functions for generating random data:
    • Booleans
    • Case iterables
    • Data
    • Floating point types
    • Integer types
    • Optionals
    • Strings
    • UUIDs
    • URLs, URL components, and URL query items
  • Stub and ThrowingStub provide stubbing and spying functionality for your mock objects.