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)
}
}
Any idea what could be making all of them succeed ?
r
robstoll
02/24/2020, 4:52 PM
are you sure that they are run?
d
Daniel
02/24/2020, 7:47 PM
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
Antoine Gagnon
02/27/2020, 7:31 PM
@Daniel Seems like I was using the basic assert from Kotlin and it wasn’t getting picked up! Thanks for the help!