File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
tests/testutils/src/main/kotlin/io/element/android/tests/testutils/lambda Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 7
7
8
8
package io.element.android.tests.testutils.lambda
9
9
10
+ import kotlin.system.exitProcess
11
+
10
12
fun lambdaError (
11
13
message : String = "This lambda should never be called."
12
14
): Nothing {
13
- throw AssertionError (message)
15
+ // Throwing an exception here is not enough, it can be caught.
16
+ // Instead exit the process to make sure the test fails.
17
+ // The error will be:
18
+ // "Could not stop all services."
19
+ // In this case, but a breakpoint here and run the test in debug mode to identify which lambda is failing.
20
+ System .err.println (message)
21
+ Thread .currentThread().stackTrace.forEach {
22
+ System .err.println (it)
23
+ }
24
+ exitProcess(1 )
14
25
}
You can’t perform that action at this time.
0 commit comments