Strikt is an assertion library for Kotlin intended for use with a test runner such as JUnit, Minutest, Spek, or KotlinTest.

Overview

Strikt

Strikt is an assertion library for Kotlin intended for use with a test runner such as JUnit, Minutest, Spek, or KotlinTest.

Strikt uses a fluent assertion style similar to AssertJ but leverages Kotlin's type system and extension functions rather than needing a complex hierarchy of assertion builder classes.

Strikt is under development, but 100% usable. The API may change until a version 1.0 is released. Any suggestions, issue reports, contributions, or feedback are very welcome.

Installation

Strikt is available from Maven Central.

") } ">
repositories {
  mavenCentral()
}

dependencies {
  testImplementation("io.strikt:strikt-core:")
}

See the button below or releases/latest for the current version number.

Additional Libraries

Strikt has the following additional libraries:

  • strikt-arrow -- supports data types from the Arrow functional programming library.
  • strikt-jackson -- supports the Jackson JSON library.
  • strikt-jvm -- supports types from the Java SDK.
  • strikt-mockk -- supports types from the MockK library.
  • strikt-protobuf -- supports Protobuf / gRPC.
  • strikt-spring -- supports the Spring Framework.

Versions are synchronized with the core Strikt library.

To install additional libraries include dependencies in your Gradle build. For example:

") } ">
dependencies {
  testImplementation("io.strikt:strikt-jvm:")
}

Bill of Materials

Strikt supplies a BOM that is useful for aligning versions when using more than one Strikt module.

")) // Versions can be omitted as they are supplied by the BOM testImplementation("io.strikt:strikt-jackson") testImplementation("io.strikt:strikt-jvm") testImplementation("io.strikt:strikt-spring") } ">
dependencies {
  // BOM dependency
  testImplementation(platform("io.strikt:strikt-bom:"))

  // Versions can be omitted as they are supplied by the BOM
  testImplementation("io.strikt:strikt-jackson")
  testImplementation("io.strikt:strikt-jvm")
  testImplementation("io.strikt:strikt-spring")
}

Using Strikt

Please see the project documentation and API docs.

Community

Join the #strikt channel on the Kotlin Slack.

Follow @stri_kt on Twitter for updates and release notifications.

Maven Central GitHub Release Date license GitHub issues GitHub Workflow Status (branch) GitHub top language Twitter Follow

Comments
  • [wip] Marks `expect` and `catching` functions as suspending

    [wip] Marks `expect` and `catching` functions as suspending

    I did a bit of playing around with this and wrote a few tests for the suspending functions, and I never had a single issue.

    Conceptually, I think it would make the most sense to have all functions that produce a subject be suspending functions, while the lambdas on asserts should not be, which is why I marked all of expect {} and catching {}. By the time the test is evaluating assertions, the data should be loaded already, and so probably shouldn't be running more the complex coroutine logic.

    Also, I've never used gradle dependency locking and couldn't figure out how to get Gradle to work with the Kotlinx Coroutines dependency, and so just commented it out for now.

    opened by cjbrooks12 10
  • single() assertion causes test that should fail to pass instead (example inside)

    single() assertion causes test that should fail to pass instead (example inside)

    I've witnessed a very strange behavior of strikt 0.29.0 (as well as 0.30.0) today. Please consider the following self-contained test:

    import org.junit.jupiter.api.Test
    import strikt.api.expectThat
    import strikt.assertions.hasSize
    import strikt.assertions.single
    
    class StriktTest {
    
        @Test
        fun thisWillFailAsIntended(){
            val list = listOf("hello", "foo")
    
            expectThat(list).hasSize(3).and { // fails the "hasSize" condition, as it should.
                get { this.filter { it == "foo" } }.single()
            }
        }
    
        @Test
        fun thisWillActuallyPass() {
            val list = listOf("hello", "foo")
    
            expectThat(list) {
                hasSize(3) // we have 2 items in the list, yet the test passes
                get { this.filter { it == "foo" } }.single()
            }
        }
    
        @Test
        fun thisWillActuallyPassToo() {
            val list = listOf("hello", "foo")
    
            expectThat(list) {
                get { this.filter { it == "foo" } }.single()
                get { this.filter { it == "bar" } }.single() // "bar" is not even in the list - yet the test passes!
            }
        }
    
    }
    

    To my amazement, the second and third test will actually pass. Even though the list certainly doesn't match all of the given criteria.

    I can't explain why that's the case. Did I do something horribly wrong with the API? Did I mis-interpret some of the methods?

    opened by MartinHaeusler 9
  • Android downward compatibility with strikt 0.27.0

    Android downward compatibility with strikt 0.27.0

    Would be great to use this library in Android development but some latest changes aren't compatible with lower Android versions than 24.

    Private interface methods are only supported starting with Android N (--min-api 24): 
    Lstrikt/api/Assertion$Builder;describe(Lkotlin/jvm/functions/Function1;)Ljava/lang/String;
    

    Any ideas to workaround this issue?

    opened by nenick 8
  • Assertion failed are not shown without adding opentest4j dependency.

    Assertion failed are not shown without adding opentest4j dependency.

    Before adding opentest4j dependency, it shows this exception whenever assertion failed occur:

    java.lang.NoClassDefFoundError: org/opentest4j/AssertionFailedError
    	at strikt.internal.AssertionStrategy.createAssertionFailedError$strikt_core(AssertionStrategy.kt:195)
    	at strikt.internal.AssertionStrategy$Throwing.afterStatusSet(AssertionStrategy.kt:151)
    	at strikt.internal.AssertionStrategy$appendAtomic$1.fail(AssertionStrategy.kt:44)
    	at strikt.api.AtomicAssertion$DefaultImpls.fail$default(AtomicAssertion.kt:19)
    	at strikt.assertions.CollectionKt$hasSize$1.invoke(Collection.kt:12)
    	at strikt.assertions.CollectionKt$hasSize$1.invoke(Collection.kt)
    	at strikt.internal.AssertionBuilder.assert(AssertionBuilder.kt:64)
    	at strikt.internal.AssertionBuilder.assert(AssertionBuilder.kt:11)
    	at strikt.assertions.CollectionKt.hasSize(Collection.kt:9)
           at ....
    	at org.spekframework.spek2.runtime.scope.TestScopeImpl.execute(Scopes.kt:94)
    	at org.spekframework.spek2.runtime.Executor$execute$$inlined$executeSafely$lambda$1$1.invokeSuspend(Executor.kt:52)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
    Caused by: java.lang.ClassNotFoundException: org.opentest4j.AssertionFailedError
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	... 18 more
    

    After I added testImplementation group: 'org.opentest4j', name: 'opentest4j', version: '1.2.0', everything works fine.

    I'm using spek version 2.0.6 for testing an Android app. It works fine with other assertion library like AssertJ.

    P/S I think it is still not fine after I adding opentest4j dependency. Here is what I got after addin the dependency:

      ✗ has size 2 : found 1
    org.opentest4j.AssertionFailedError: ▼ Expect that [Mock for Class, hashCode: 17337594]:
      ✗ has size 2 : found 1
    	at ...
    	at ....
    	at org.spekframework.spek2.runtime.scope.TestScopeImpl.execute(Scopes.kt:94)
    	at org.spekframework.spek2.runtime.Executor$execute$$inlined$executeSafely$lambda$1$1.invokeSuspend(Executor.kt:52)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
    	Suppressed: org.opentest4j.AssertionFailedError
    		at strikt.internal.AssertionStrategy.createAssertionFailedError$strikt_core(AssertionStrategy.kt:195)
    		at strikt.internal.AssertionStrategy$Throwing.afterStatusSet(AssertionStrategy.kt:151)
    		at strikt.internal.AssertionStrategy$appendAtomic$1.fail(AssertionStrategy.kt:44)
    		at strikt.api.AtomicAssertion$DefaultImpls.fail$default(AtomicAssertion.kt:19)
    		at strikt.assertions.CollectionKt$hasSize$1.invoke(Collection.kt:12)
    		at strikt.assertions.CollectionKt$hasSize$1.invoke(Collection.kt)
    		at strikt.internal.AssertionBuilder.assert(AssertionBuilder.kt:64)
    		at strikt.internal.AssertionBuilder.assert(AssertionBuilder.kt:11)
    
    opened by lenguyenthanh 8
  • expect {...}.throws works only when the block returns unit

    expect {...}.throws works only when the block returns unit

            expect {}.throws<java.lang.RuntimeException>() // this works
            expect {"blah"}.throws<java.lang.RuntimeException>() // this is red in idea
            throws<RuntimeException> {"blah"} // this works
    

    this is a really strange problem, the kotlin compiler seems to be fine with a ()-> Unit block returning something in line 3 but in line 2 it complains

    🐛 bug 
    opened by christophsturm 8
  • failing containsExactly expectation logs error twice.

    failing containsExactly expectation logs error twice.

    or maybe even three times if you count the expected: null

    this is with current master.

    the output for this one line: expect(listOf(1,2,3)).containsExactly(1,2)

    is

    Expected :null
    Actual   :[3]
     <Click to see difference>
    
    
    
    strikt.internal.opentest4j.CompoundAssertionFailure: ✗ contains exactly the elements [1, 2]
      ✗ contains no further elements : found [3]
    
    	at strikt.internal.CompoundAssertionNode.toError(AssertionNode.kt:136)
    	at strikt.internal.AssertionNodeKt.toErrors(AssertionNode.kt:144)
    	at strikt.internal.AssertionNodeKt.access$toErrors(AssertionNode.kt:1)
    	at strikt.internal.AssertionSubject.toError(AssertionNode.kt:73)
    	at strikt.internal.AssertionGroup$DefaultImpls.throwOnFailure(AssertionNode.kt:31)
    	at strikt.internal.AssertionSubject.throwOnFailure(AssertionNode.kt:40)
    	at strikt.internal.AsserterImpl.throwOnFailure(AsserterImpl.kt:168)
    	at strikt.internal.AsserterImpl.access$throwOnFailure(AsserterImpl.kt:15)
    	at strikt.internal.AsserterImpl$compose$$inlined$let$lambda$1.then(AsserterImpl.kt:147)
    	at strikt.assertions.IterableKt.containsExactly(Iterable.kt:145)
    ...
    
    strikt.internal.opentest4j.CompoundAssertionFailure: ▼ Expect that [1, 2, 3]:
      ✗ contains exactly the elements [1, 2]
        ✗ contains no further elements : found [3]
    
    	at strikt.internal.AssertionSubject.toError(AssertionNode.kt:73)
    	at strikt.internal.AssertionGroup$DefaultImpls.throwOnFailure(AssertionNode.kt:31)
    	at strikt.internal.AssertionSubject.throwOnFailure(AssertionNode.kt:40)
    	at strikt.internal.AsserterImpl.throwOnFailure(AsserterImpl.kt:168)
    	at strikt.internal.AsserterImpl.access$throwOnFailure(AsserterImpl.kt:15)
    	at strikt.internal.AsserterImpl$compose$$inlined$let$lambda$1.then(AsserterImpl.kt:147)
    	at strikt.assertions.IterableKt.containsExactly(Iterable.kt:145)
    ...
    

    at least in idea.

    🐛 bug 
    opened by christophsturm 8
  • Having trouble with custom assertions

    Having trouble with custom assertions

    Hi Folks,

    I've been using strikt in a project and have come to a point where I would like to use the custom assertion feature. Up to now my "custom" assertion has looked like this:

    fun assertResult(e: Outcome, r: Response<out Any>) {
            expectThat(r.outcome).isEqualTo(e)
        }
    

    I rewrote the assertion following the guide on the website, and have ended up with the following:

    fun Assertion.Builder<Response<out Any>>.hasOutcome(o: Outcome) =
            assert("has outcome of $o") {
                when (it.outcome) {
                    o -> pass()
                    else -> fail(actual = it.outcome)
                }
            }
    

    This seems to compile fine, however when I actually try and use it I get this error:

    expectThat(subject.execute(request, ::id))
                .hasOutcome(Outcome.INVALID_DATA)
    
    //Error:(35, 9) Kotlin: Type mismatch: inferred type is DescribeableBuilder<Response<Brand>> but Assertion.Builder<Response<out Any>> was expected
    

    I can see that DescribeableBuilder does inherit from Assertion.Builder, however it doesn't seem to be able to see the extension methods. If I add an extra assertion in front of my custom one it works fine like so:

    expectThat(subject.execute(request, ::id))
                .isA<Response<out Any>>()
                .hasOutcome(Outcome.INVALID_DATA)
    

    However I don't think this should be necessary? Any help is much appreciated!

    update: Changing the signature to

        fun <T> Assertion.Builder<Response<T>>.hasOutcome(o: Outcome) =
            assert("has outcome of $o") {
                when (it.outcome) {
                    o -> pass()
                    else -> fail(actual = it.outcome)
                }
            }
    

    then works, but I'm not entirely sure why since I would have thought that would match any object, regardless of generics?

    opened by ejhobbs 7
  • get { ... } auto-descriptions do not work on windows

    get { ... } auto-descriptions do not work on windows

    Hi,

    strikts feature to display the actual code passed into a get { thisAndThat } is extremely useful. It's also okay to display the object value as a fallback if the resolver doesn't produce a result. However, under windows, the resolver fails very often for a simple reason:

    FilePeek.kt, lines 30 - 36: Here you check for things like "/out/", but when running under windows, the variable classFilePath contains backslashes (\) instead as separators.

    Could you please replace the hard-coded / characters by File.separator to make it work under windows too?

    Thanks.

    opened by MartinHaeusler 6
  • strange

    strange "expect that" output for jackson nodes

    this code

        @Test
        fun `jackson`() {
            val node = jacksonObjectMapper().readTree(""" {"blah":"blerg"} """)
            print(node.toString())
            expect(node).map(JsonNode::isBigDecimal).isTrue()
        }
    

    outputs this:

    {"blah":"blerg"}
    
    Expected :true
    Actual   :false
     <Click to see difference>
    
    
    
    strikt.internal.opentest4j.CompoundAssertionFailure: ▼ Expect that [[]]:
      ▼ Expect that .isBigDecimal false:
        ✗ is true : found false
    
    
    opened by christophsturm 6
  • [suggestion] Pass subject as parameter to Assertion.Builder callbacks

    [suggestion] Pass subject as parameter to Assertion.Builder callbacks

    When writing custom assertions, the only way to get the subject is directly from the Assertion receiver's subject parameter. A more idiomatic, Kotlin-y way to access the subject would be having it passed as the sole argument to the callback, which can be accessed implicitly as the it parameter, or be named as needed by the end-user.

    The new signature would look something like:

    // in strikt/api/Assertion.kt
    fun assert(
          description: String,
          expected: Any?,
          assert: AtomicAssertion<T>.(T) -> Unit
        ): Builder<T>
    

    Example usage:

    fun Assertion.Builder<LocalDate>.isStTibsDay() =
      assert("is St. Tib's Day") {
        when (MonthDay.from(it)) {
          MonthDay.of(2, 29) -> pass()
          else               -> fail()
        }
      }
    

    or

    fun Assertion.Builder<LocalDate>.isStTibsDay() =
      assert("is St. Tib's Day") { dateUnderTest ->
        when (MonthDay.from(dateUnderTest)) {
          MonthDay.of(2, 29) -> pass()
          else               -> fail()
        }
      }
    
    🦄 enhancement 💥 breaking change 
    opened by cjbrooks12 6
  • should numbers be equal to numbers of different type?

    should numbers be equal to numbers of different type?

    I think that expect(1L).isEqualTo(1) should pass, because its an implementation detail that its a long. also 1L == 1 is true. most other assertion libs seem to not agree with me here, just putting it up for discussion.

    maybe isEqualTo should be changed to take T? (or a subtype of T?) instead of Any?? it boils down to the question, should isEqualTo work like the == operator, or like the equals method. right now the docs say that it works like == but in reality it works like equals, and i think it would be better if it worked like ==

    🤔 question 
    opened by christophsturm 6
  • Do not print passed checks

    Do not print passed checks

    I have the following snippet:

    expectThat(1) {
      isLessThan(1)
      isLessThan(2)
    }
    

    The output is:

    ▼ Expect that 1:
      ✗ is less than 1
      ✓ is less than 2
    

    Is there a way to omit passed checks to have only

    ▼ Expect that 1:
      ✗ is less than 1
    

    I have many nested checks for a big collection, and the output is too big to reason.

    opened by ankh-bigpay 0
  • Add filterNotNull() for Iterables.

    Add filterNotNull() for Iterables.

    fun <T> Builder<out Iterable<T?>>.filterNotNull(): Builder<List<T>> =
            get { this.filterNotNull() }
    

    Would make a nice addition to the already existing filter, filterNot and filterIsInstance.

    opened by mlewe 0
  • Add assertion for a non-continuous sequence in an Iterable

    Add assertion for a non-continuous sequence in an Iterable

    This is a request for a new assertion which checks whether the subject Iterable contains the given elements in order provided, possibly with other items between them. AssertJ has that feature: containsSubsequence(ELEMENT... sequence), though I'm not a fan of that name. I'd call it either containsNonContinuousSequence or containsInOrder (as opposed to just contains, which doesn't verify the order and containsExactly, which checks the order, but doesn't allow other items).

    This was already raised in #156 but the closing PR resolved only half of that feature request. Additionally, that PR implemented containsSequence on Lists, but I think it'd make more sense to implement that more broadly on Iterables.

    I could try implementing this if that's okay.

    opened by Jasz 0
  • Should MappingFailed extend AssertionFailedError?

    Should MappingFailed extend AssertionFailedError?

    Currently if some code wants to handle assertion failures, this doesn't work for strikt helpers like first() because MappingException extends IncompleteExecutionException, not AssertionError. eg:

      private val failures = mutableListOf<AssertionError>()
    
      fun doSomethingWithFailures(runnable: Runnable) {
        try {
          runnable.run()
        } catch(assertionFailed: AssertionError) {
          failures.add(assertionFailed)
          throw assertionFailed
        }
      }
    
      private fun thingUnderTest() = emptyList<String>()
    
      // failure will be added to failures
      @Test
      fun `thingUnderTest has a catflap`() {
        doSomethingWithFailures {
          expectThat(thingUnderTest()).contains("catflap")
        }
      }
    
      // failure will not be added to failures
      @Test
      fun `thingUnderTest has a catflap first`() {
        doSomethingWithFailures {
          expectThat(thingUnderTest()).first().isEqualTo("catflap")
        }
      }
    
    

    Would it be better to have MappingException extend org.opentest4j.AssertionFailedError instead?

    opened by robd 0
  • "propertiesAreEqualToIgnoring" does not work for some property names

    The function is very useful but unfortunately Java introspection seems to have its own ideas about naming, so that properties are not ignored when their name starts with a lowercase letter immediately followed by an uppercase letter:

    class PropertiesDemo {
        data class Bean(
            val lowercase: String,
            val camelCase: String,
            val bRoken: String,
        )
        val bean = Bean("bean", "bean", "bean")
    
        @Test
        fun camelCase() {
            val copied = bean.copy(camelCase = "different")
            expectThat(copied).propertiesAreEqualToIgnoring(bean, Bean::camelCase)
        }
    
        @Test
        fun lowerCase() {
            val copied = bean.copy(lowercase = "different")
            expectThat(copied).propertiesAreEqualToIgnoring(bean, Bean::lowercase)
        }
    
        @Test
        fun bRoken() {
            val copied = bean.copy(bRoken = "different")
            expectThat(copied).propertiesAreEqualToIgnoring(bean, Bean::bRoken)
        }
    }
    

    When you run the above tests, you'll find that strikt sees the property Bean::bRoken as "BRoken" and therefore does not ignore it and fails the test.

    opened by tmohme 0
Releases(v0.34.1)
  • v0.34.1(Feb 3, 2022)

    • Removes the overload of isNotNull to avoid overload ambiguity when the subject is a platform type.

    Full Changelog: https://github.com/robfletcher/strikt/compare/v0.34.0...v0.34.1

    Source code(tar.gz)
    Source code(zip)
  • v0.34.0(Jan 31, 2022)

  • v0.33.0(Nov 16, 2021)

    What's Changed

    • Support Kotlin 1.6.0
    • Add 'doesNotContainKey' and 'doesNotContainKeys' map assertions by @r0adkll in https://github.com/robfletcher/strikt/pull/247

    New Contributors

    • @r0adkll made their first contribution in https://github.com/robfletcher/strikt/pull/247

    Full Changelog: https://github.com/robfletcher/strikt/compare/v0.32.0...v0.33.0

    Source code(tar.gz)
    Source code(zip)
  • v0.32.0(Aug 25, 2021)

    • Supports Kotlin 1.5
    • Removes strikt-gradle module as classpath isolation is problematic with Kotlin 1.5 and the gradleTestKit dependency.
    • Adds Assertion.Builder<T>.subject : T property for accessing the subject value.
    Source code(tar.gz)
    Source code(zip)
  • v0.31.0(Apr 25, 2021)

    • Incomplete assertion chains now throw IncompleteAssertion.
    • Suppresses class name in the toString of exceptions thrown by Strikt assertions.
    • Updates strikt-arrow to support recent changes in the Arrow library.
    Source code(tar.gz)
    Source code(zip)
  • v0.30.1(Apr 11, 2021)

  • v0.30.0(Mar 27, 2021)

  • v0.29.0(Feb 7, 2021)

    • Moves several JVM-specific assertions to the new strikt-jvm module.
    • Removes the strikt-java-time module (use strikt-jvm instead).
    • Adds isSorted assertion for Iterable<Comparable<*>>.
    • Broadens isSorted(Comparator) so that it applies to Iterable<*> rather than Collection<*>.
    Source code(tar.gz)
    Source code(zip)
  • v0.28.2(Jan 26, 2021)

    • Removes support for Arrow's Try type that has been removed from arrow-core.
    • Adds anyIndexed, allIndexed, and noneIndexed assertions for Iterable<*>.
    Source code(tar.gz)
    Source code(zip)
  • v0.28.1(Dec 1, 2020)

    • Adds count() and count(predicate) mappings for Iterable subjects.
    • Additional support for File subjects. See #230
      • mapping property Assertion.Builder<File>.parentFile: Builder<File>
      • mapping property Assertion.Builder<File>.lastModified: Long
      • mapping property Assertion.Builder<File>.length: Long
      • mapping property Assertion.Builder<File>.childFiles: Builder<List<File>>
      • mapping function Assertion.Builder<File>.childFile(name): Builder<File>
      • assertion Assertion.Builder<File>.exists()
      • assertion Assertion.Builder<File>.notExists()
      • assertion Assertion.Builder<File>.isRegularFile()
      • assertion Assertion.Builder<File>.isNotRegularFile()
      • assertion Assertion.Builder<File>.isDirectory()
      • assertion Assertion.Builder<File>.isNotDirectory()
      • assertion Assertion.Builder<File>.isReadable()
      • assertion Assertion.Builder<File>.isNotReadable()
      • assertion Assertion.Builder<File>.isWritable()
      • assertion Assertion.Builder<File>.isNotWritable()
      • assertion Assertion.Builder<File>.isExecutable()
      • assertion Assertion.Builder<File>.isNotExecutable()
    Source code(tar.gz)
    Source code(zip)
  • v0.28.0(Sep 13, 2020)

  • v0.27.0(Aug 18, 2020)

  • v0.26.1(May 11, 2020)

    New features

    • Assertion.Builder<Iterable<E>>withFirst
    • Assertion.Builder<Iterable<E>>withFirst(predicate)
    • Assertion.Builder<Iterable<E>>withLast
    • Assertion.Builder<Iterable<E>>withElementAt
    • Assertion.Builder<Map<K, V>>withValue
    • Assertion.Builder<CapturingSlot<T>>withCaptured in strikt-mockk.
    Source code(tar.gz)
    Source code(zip)
  • v0.26.0(May 4, 2020)

    New features

    • succeeded and failed deprecated in favor of isSuccess and isFailure.
    • added Assertion.Builder<Enum<T>>.isOneOf assertion.

    Fixes

    • single now displays the number of elements found if it fails. See #210
    • Improved description of task mapping. See #218
    Source code(tar.gz)
    Source code(zip)
  • v0.25.0(Mar 27, 2020)

  • v0.24.0(Feb 26, 2020)

    • New methods:
      • Assertion.Builder<Iterable<T>>.elementAt
      • Assertion.Builder<Iterable<T>>.one
      • Assertion.Builder<ArrayNode>.findValuesAsText
      • Assertion.Builder<ArrayNode>.textValues
    Source code(tar.gz)
    Source code(zip)
  • v0.23.7(Feb 13, 2020)

  • v0.23.6(Feb 10, 2020)

  • v0.23.5(Feb 9, 2020)

  • v0.23.4(Jan 6, 2020)

  • v0.23.3(Jan 1, 2020)

  • v0.23.2(Dec 11, 2019)

  • v0.23.1(Dec 10, 2019)

  • v0.23.0(Dec 10, 2019)

    • Adds with function for performing blocks of assertions on a derived subject. See #117
    • Many assertion functions may now be used in infix style. See #187
    • Improves presentation of multi-line values in expectation output. See #158

    Breaking changes

    • The expectThat override that accepts a lambda is now Unit rather than returning Assertion.Builder. See #190
    Source code(tar.gz)
    Source code(zip)
  • v0.22.3(Nov 23, 2019)

  • v0.22.2(Sep 25, 2019)

  • v0.22.1(Sep 16, 2019)

  • v0.22.0(Sep 15, 2019)

  • v0.21.2(Sep 14, 2019)

  • v0.21.1(Jun 23, 2019)

Owner
Rob Fletcher
Member of the @spinnaker team at Netflix
Rob Fletcher
A custom instrumentation test runner for Android that generates XML reports for integration with other tools.

Android JUnit Report Test Runner Introduction The Android JUnit report test runner is a custom instrumentation test runner for Android that creates XM

Jason Sankey 148 Nov 25, 2022
A multiplatform assertion library for Kotlin

Atrium is an open-source multiplatform assertion library for Kotlin with support for JVM, JS and Android. It is designed to support multiple APIs, dif

Robert Stoll 439 Dec 29, 2022
This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5

Kotlin-RestAssured Test Automation This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5 Introduction All the Test Cases kept

Dilshan Fernando 0 Dec 9, 2021
Android Sample Kotlin+ MVVM + Coroutines + Retrofit +Hilt+ Junit + Mockito

NTimes AppSample NY Times Most Popular Articles simple app to hit the NY Times Most Popular Articles API and show a list of articles, that shows detai

Amer Elsayed 0 Dec 27, 2021
kraskaska-runner: This application allows you to automatically restart specific command. Initially made for minecraft servers.

kraskaska-runner This application allows you to automatically restart specific command. Initially made for minecraft servers. Usage: Usage: kraskaska-

Kraskaska 2 Aug 30, 2022
JUnit 5 Studies For Android

Estudos sobre JUnit 5 Objetivo A proposta desse projeto é estudar a documentação do JUnit 5 traduzindo-a com exemplos e com a meu entendimento sobre a

João Pedro Medeiros de Farias 3 Jul 16, 2022
Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project.

Kotlin API for React Test Renderer Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project. How

Xavier Cho 7 Jun 8, 2022
Toster - Small test dsl based on adb commands that allows you to test the mobile application close to user actions

toster Small test dsl based on adb commands that allows you to test the mobile a

Alexander Kulikovskiy 31 Sep 1, 2022
Lbc-test-app - Test Android Senior Leboncoin

Test Android Senior Leboncoin ?? Mathieu EDET Overview Min API version : 24 This

null 0 Feb 7, 2022
Linkester is an Android library that aims to help Android developers test their deep links implementation.

Linkester Linkester is an Android library that aims to help Android developers test their deep links implementation. The idea is to have a new launche

Ahmad Melegy 79 Dec 9, 2022
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing

Kotest is a flexible and comprehensive testing tool for Kotlin with multiplatform support. To learn more about Kotest, visit kotest.io or see our quic

Kotest 3.8k Jan 3, 2023
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to go

PowerMock 3.9k Jan 5, 2023
null 866 Dec 27, 2022
A powerful test framework for Android

Cafe A powerful test framework for Android named Case Automated Framework for Everyone. Home Page http://baiduqa.github.com/Cafe/ How to make Cafe dow

Baidu 367 Nov 22, 2022
TestObserver to easily test LiveData and make assertions on them.

JCenter Update LiveData Testing is currently published on JCenter - it will serve packages until February 1st, 2022. LiveData Testing packages will be

Josef Raska 395 Dec 8, 2022
A powerful test framework for Android

Cafe A powerful test framework for Android named Case Automated Framework for Everyone. Home Page http://baiduqa.github.com/Cafe/ How to make Cafe dow

Baidu 367 Nov 22, 2022
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to go

PowerMock 3.9k Jan 2, 2023
Barista makes developing UI test faster, easier and more predictable. Built on top of Espresso

Barista makes developing UI test faster, easier and more predictable. Built on top of Espresso, it provides a simple and discoverable API, removing most of the boilerplate and verbosity of common Espresso tasks. You and your Android team will write tests with no effort.

Adevinta Spain 1.6k Jan 5, 2023
Easily scale your Android Instrumentation Tests across Firebase Test Lab with Flank.

Easily scale your Android Instrumentation Tests across Firebase Test Lab with Flank.

Nelson Osacky 220 Nov 29, 2022