New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node JS tests do not report failures correctly #3329
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Tried with the latest version ( |
I have the same issue (Kotlin 1.8.21, Kotest 5.6.2, Node 18.12.1, multiplatform project setup with 2 Node applications and 2 shared modules). When running
|
Hi, have someone managed to get It has something to do with |
Nope, for now I simply do not use Kotest for my JS compilation and only test my JVM one |
It seems that it stopped working since version Don't know how bad it is to have a difference in version between the libs and the plugin, but at least I managed to run my tests on all the platforms... |
Was looking at open issues before trying out Kotest. |
Is there some JS code I need in order to run generateTypeScriptDefinitions to test this out ? |
As far as I know you do not need any specific JS code to trigger the js(IR) {
moduleName = "foobar"
nodejs()
binaries.library()
useCommonJs()
generateTypeScriptDefinitions()
} |
Seems to me like the Kotest Multiplatform plugin forces the entire module to use Kotlin 1.8.20, or probably the 1.8.20 Kotlin Gradle plugin to be precise. I was suspicious of this since I wasn't able to use Was generateTypeScriptDefinitions() not introduced before 1.9? As that might explain the issue then. I'm also very dependent on that feature. A workaround for now (at least for me) is adding this to the
|
jsNodeTest must remain disabled until #3329 gets fixed
Back to the original problem: This seems to be caused by the Kotlin/Gradle plugin-provided Mocha:
|
* Use the `FrameworkAdapter` interface provided by the Kotlin/JS test infra, so that failed tests are correctly reported for the JS target on Node.js (does not apply to Wasm/JS, which does not require "adapter transformation"). * Use JS Promise instead of callbacks to interact with the JS test framework. * Clean up the code to avoid API layers changing from Mocha/Jasmine style ("describe", "it) to Kotlin test style ("suite", "test) and back.
When writing tests using
kotlin-test
, a failure is properly reported in the console/XML file, for example the following codegives the following output
But if I use Kotest, the following code
The only output I get is
After a bit of investigation, Kotlin had a similar issue with 1.7.20 ( fix commit ) so there might be some pointers in there. It should be noted that the tests run correctly though, if you run the nodeJS command manually, you get the Mocha test output and can see the failures reported correctly
Versions used :
The text was updated successfully, but these errors were encountered: