Hi all, I’m having some issues where all my instru...
# test
a
Hi all, I’m having some issues where all my instrumentation tests in Android succeed even when I put completely wrong info in my testing function such as:
Copy code
class MathTest {

    @Test
    fun test_should_fail_function() {
        assert(2.0.pow(24) == 2.0)
    }
}
In my build.gradle I have these imports:
Copy code
// Android Instrumentation
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.0.0"
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.0.0"
Any idea what could be making all of them succeed ?
r
are you sure that they are run?
d
Where is
assert
from? Best try assertThat() from assertJ or JUnit. Maybe there is a wrong exception trhown which somehow interferec with the JUnit framework. Also maybe there is no test runner specified?
a
@Daniel Seems like I was using the basic assert from Kotlin and it wasn’t getting picked up! Thanks for the help!