-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Bug 🐛Product not working as expectedProduct not working as expectedCompatibility 💕Product compatibility with the ecosystemProduct compatibility with the ecosystem
Description
Given a defective test configuration triggering a runtime error:
import de.infix.testBalloon.framework.TestDiscoverable
import de.infix.testBalloon.framework.TestSuite
import de.infix.testBalloon.framework.testSuite
val outer by testSuite {
@TestDiscoverable
fun customTest1(name: String, action: suspend () -> Unit) = test(name) {
action()
}
@TestDiscoverable
fun TestSuite.customTest2(name: String, action: suspend () -> Unit) = test(name) {
action()
}
testSuite("inner") {
customTest1("not OK") { // registering a test in `outer`, invoked in `inner`
}
customTest2("OK") {
}
}
}TestBalloon usually reports it like in this JVM example:
TestEngine with ID 'de.infix.testBalloon' encountered a critical issue during test discovery:
(1) [ERROR] Could not configure outer.inner
java.lang.IllegalArgumentException: Test(outer.not OK) tried to register as a child of TestSuite(outer), which currently is not the closest configuration scope.
The closest configuration scope at this point is TestSuite(outer.inner).
at CustomFunctionWithWrongParentSuiteKt.outer_delegate$lambda$1$customTest1(customFunctionWithWrongParentSuite.kt:7)
[...]
This is not the case with Wasm/JS/Browser:
| Task | Meaningful error message | Task failure |
|---|---|---|
| jvmTest | Yes | Yes |
| linuxX64Test | Yes | Yes |
| jsNodeTest | Yes | Yes |
| jsBrowserTest | Yes | Yes |
| wasmJsBrowserTest | No | Yes |
| wasmJsNodeTest | Yes | Yes |
| wasmWasiNodeTest | Yes | Yes |
Metadata
Metadata
Assignees
Labels
Bug 🐛Product not working as expectedProduct not working as expectedCompatibility 💕Product compatibility with the ecosystemProduct compatibility with the ecosystem