Skip to content

Releases: willowtreeapps/assertk

v0.21

30 Jul 15:28
3f63612
Compare
Choose a tag to compare

Added

  • Add any to iterable assertions. It will pass when any of the provided assertions pass.

Changed

  • Minimum supported kotlin version is 1.3.60
  • Changed the signatures of isEqualToWithGivenProperties and isEqualToIgnoringGivenProperties to
    be able to take nullable properties.
  • Improved the output of containsExactly to show the entire list.
  • Render tabs and newlines in diffs to make clear what's different.

Fixed

  • Fixed issues with nested soft assertions. (#253)

v0.20

30 Jul 15:27
2b664da
Compare
Choose a tag to compare

Added

  • Add corresponds/doesNotCorrespond to compare values with a correspondence function. This is
    useful when the value doesn't implement equals.

Changed

  • Changed the signature of isEqualTo from Any? to T. This should not effect any existing code
    due to T being covariant. The one improvement this brings is that literal numbers can be inferred
    to the correct type. Before this change assertThat(1L).isEqualTo(1) would fail, now it passes.

Fixed

  • Fixed isSuccess failing on null return values

v0.19

20 Jul 23:07
Compare
Choose a tag to compare

Fixed

  • Fixed thread-safety issue with soft assertions

v0.18

13 Jul 14:13
Compare
Choose a tag to compare

Added

  • Add extracting to allow extracing a value for each item in an array.
  • Add Assert<Result<T>>.isSuccess() and Assert<Result<T>>.isFailure() to replace AssertBlock assertions.
  • Add messageContains for throwable.

Changed

  • Minimum supported kotlin version is 1.3.40
  • assertThat {} and catch {} are inlined for better coroutine support
  • Improved display of Pair and Triple

Breaking Changes

  • AssertBlock is removed and it's methods have been turned into extension functions on Assert<Result<T>>.
    You can migrate by:
    1. Alt-enter on returnedValue, thrownError, and doesNotThrowAnyException and select import.
    2. Alt-enter on the deprecated version of above and choose replace with...
    3. If your expression only has 1 value, you can replace ex: isSucess().all { isEqualTo(1) } with isSuccess().isEqualTo(1)

Deprecated

  • Deprecated catch in favor of assertThat {}.isFailure()

v0.17

13 Jul 14:14
Compare
Choose a tag to compare

Fixed

  • Fixed transitive dep in js artifact

v0.16

13 Jul 14:14
Compare
Choose a tag to compare

Fixed

  • Fixed js artifact

v0.15

13 Jul 14:14
Compare
Choose a tag to compare

Added

  • Add isEqualToIgnoringGivenProperties for the JVM
  • Add support for kotlin native
  • Add none assertion for iterables

Changed

  • Minimum supported kotlin version is 1.3.30
  • Common artifact changed from assertk-common to assertk
  • All previous deprecations on now at level error

Removed

  • Deprecated containsExactly for maps

v0.14

13 Jul 14:15
3a9738e
Compare
Choose a tag to compare

Added

  • Add assertThat for Kotlin property based assertions.

Fixed

  • Fixed showing null expected/actual values in intellj when those values aren't provided. (#180)
  • Fixed IndexOutOfBoundsException in containsExactly differ (#185)
  • Fixed block asserts not respecting assertAll

v0.13

13 Jul 14:15
c2ecbf8
Compare
Choose a tag to compare

Added

  • Add isDataClassEqualTo for better messaging when comparing data classes.
  • Add matchesPredicate to match against a predicate function/lambda.
  • Add atLeast iterable assertion which passes if the assertion on each item passes at least n times.
  • Add isCloseTo for floats and doubles to check that a value is within a delta of what's expected.
  • Add lines and bytes to Path assertions for asserting on a file's contents.
  • Add containsOnly for Collection assertions.

Changed

  • Sort containsExactly output by index to make it easier to compare.
  • containsAll now includes the expected map.

Fixed

  • Number assertions now work correctly on BigInteger and BigDecimal
  • Soft assertions breaking if exception is thrown.

Deprecated

  • Deprecated assert in favor of assertThat.
  • Deprecated accessing the actual value on an assertion directly. Instead use given which will provide it in a lambda.
  • Deprecated some methods that took a lambda, replacing them with versions that chain instead.
    • isNotNull()
    • isInstanceOf()
    • index()
    • key()

Breaking Changes

  • Previously deprecated methods (as of 0.10) are now errors.

v0.12: Merge pull request #120 from willowtreeapps/packaging-fixes

13 Jul 14:15
ef171bc
Compare
Choose a tag to compare

Fixed

  • Bumped the kotlin version to 1.2.50 to fix a packaging issue.
  • Remove <packaging>pom</packaging> as it should be using the default jar packaging.