:mega: :testballoon: <https://github.com/infix-de/...
# testballoon
o
📣 testballoon TestBalloon 1.2.0 is out, along with the latest IDE plugin releases on the Stable channel! Migration is as boring as it can be. 🥱 Backwards compatibility has reached a new high, going back in time to JDK 8 and Android SDK 23. Yet, the future 🌠 is built in with the new Playwright-based browser test integration for JS (since Kotlin 2.4.20) and Wasm/JS (starting with Kotlin 2.5.0-Beta2). The new mechanism significantly reduces the JS ecosystem exposure, eliminating Karma and Mocha for TestBalloon. Android folks might enjoy the new screenshot testing example using Roborazzi (thanks to @Eugen Martynov for the idea). And finally, TestBalloon now runs some test suites even 🚀 faster, as it releases memory resources as early as possible. ❤️ Special thanks to • @mbonnin for providing the new Maven Central publication scheme and taming all those versioning details with Gradle, KGP, compiler, stdlib, ... • @Anton Lakotka [JB] for cooperating on the new browser test integration, making sure that all the necessary APIs were in place to support TestBalloon in first-party quality. Enjoy! 🎆
kodee happy 3
kodee loving 3
🔥 2
testballoon 2
K 9
r
What does
withTestBalloon()
do with new playwright-based tests? Is TestBaloon not used without this call?
I'm configuring my tests with
buildSrc
and have problems finding this function even after adding testballoon-gradle-plugin as a dependency
It does find
import de.infix.testBalloon.gradlePlugin.internal.layer.kotlin2420.withTestBalloon
in my
buildSrc
source code, but build files don't compile when I use it (
Extension with name 'testBalloon' does not exist.
).
I've found the issue. I was missing plugin application in a subproject without tests.
Still I'm not sure there is any difference when I have this call.
o
What you're probably observing is TestBalloon running tests via Playwright even without extra configuration. But this mode has limitations: • Test selection (filtering) does not work (TestBalloon always runs all tests). • Hierarchical test reporting in the IDE does not work (because the corresponding reporting mode is not set). • TestBalloon does not receive (simulated) user environment variables. • The reduced JS footprint is not in effect (Mocha gets loaded and TestBalloon integrates with Mocha). For proper operation, you currently need
withTestBalloon()
. The idea is to make it disappear completely in favor of full autoconfiguration, but this requires
KotlinJsBrowserDsl.test
to become configurable in a reactive way: KT-90261
thank you color 1
p
Fwiw without the
withTestBalloon
we ran into this issue youtrack.jetbrains.com/issue/KT-90719. The mocha version isn't pinned and so there was some conflicts between the test reporting version of mocha and the runner version of mocha (I think? tbh that's just what my agent explained to me, I didn't dig in too deep since withTestBalloon fixed it)
o
According to KT-90719, the agent's explanation is wrong. Mocha just crashes. Of course, making Testballoon avoid Mocha implies that the source of the crash is gone. ☺️
p
Right the crashing is because an incompatible version is being loaded in and it is trying to invoke the class as a function (this was a breaking change in mocha 12)
o
👍 TL;DR: What's not there can't crash. 😉
💯 1
p
Always a win!
o
And there's more. Counting the packages in
package-lock.json
of a simple example project: • TestBalloon/JS with traditional tests (Karma): 298 packages • TestBalloon/JS with new test DSL (Playwright): 174 packages Using TestBalloon with the new test DSL reduces the JS ecosystem footprint by 42%.
p
Yeah the PR deleted ~1.3kloc from our yarn.lock
kodee happy 1