Hi there! I am having problems with jsTest and jsB...
# kotest
p
Hi there! I am having problems with jsTest and jsBrowserTest in a multiplatform project. On my machine tests are no longer executed for JS. When I create a test like
Copy code
"FAIL!" {
   fail("BOOOM!")
}
I still see all tests being successful. The test suite also worked last week and the JS and Common tests where executed properly and suddenly stopped doing so. Does anyone have an idea what is wrong here. I am running on Ubuntu 20.04 and Kotest 5.2.3, Kotlin 1.6.20. I also know that my browsers where updated last week... So yeah am I lost here. Any help, ideas or pointers is very much appreciated!
☝🏻 1
s
It seems like something broke in 1.6.20
p
So am I not the only one with this issue?
s
@Jim has it too I think
j
Yeah 😔 I abandoned updating to .20 for now
s
If you can track down the issue @Jim I might be able ot fix
p
Thank you for your help. I can confirm that 1.6.10 works for as well. I have the feeling the Js-Code is generated differently in 16.20, and maybe it optimizes the Test classes away...
After looking into the generated JS code for the test runner I see this: EDIT: talking about 1.6.20 in the message below
I have two tests, one in commonTest, one in jsTest
The js code does this:
Somehow the JavascriptSpec appears in the common section...
... i have not clue what this really means, and maybe this is totally ok. It just looks a bit odd.
In 1.6.10 the JS-Code looks like this
and below there is
Ok... and then again in 1.6.20 :
Copy code
init_properties_CommonSpec_kt_658525396
is called here:
and guess where
_get_launcher__806741035
is called?
Right, nowhere...
@sam and @Jim what do you think?
s
Yeah I think that sounds like the issue.
the compiler plugin places all the specs into a val
j
Now that you mention it I read in the either #javascript or #react that JavaScript wasn't auto running
p
Should I create an issue in kotest/kotest? @sam
s
pls
p
Or should I go into more detail in the issue description?
s
That's good
j
I was digging through the docs and it looks like here in the "what's new for 1.6.20" they suggest using the
@EagerInitialization
annotation
If for some reason you need to initialize a property eagerly (upon the application start), mark it with the
@EagerInitialization
annotation.
Wondering if we can slap that on whatever generates
getLauncher
s
Yeah but seems to be native only? Unless they just haven't updated the docs yet
j
Yeah I imagine not, cause that's directly under the JS IR section in the what's new docs
I can't find where that
get_launcher
comes from 🤔
s
the compiler plugin prob
s
maybe its a new thing generated by the js compiler
j
ok I'm not able to import that annotation, so we might just be dead in the water here 🤔
p
Hey! What would happen when we make the
launcher
field NOT final here:
The idea being to make the field a "var" instead of a "val". Maybe a var is not lazily initialized.
@sam and @Jim what do you think?
s
Can try it
j
I'll try to include that in my annotation change
I'll try to get a PR out over lunch
❤️ 1
s
j
Sam is the fastest 🙏
p
🦜
b
Will there be a release soon or is there a way to use the snapshot builds of the plugin?
s
today probably, I'm trying to get the intellij plugin working so that we can run individual JS / Native tests
👍 1
b
Until the release: Are there snapshot builds of the plugin? I saw, that there are oss snapshots, but what is the plugin naming?
s
This isn't a plugin thing, you can use the latest kotest snapshot
b
I thought for JS we need the multiplatform plugin?
s
it's all controlled by the main kotest library
Try 5.3.0.968-SNAPSHOT
b
Perfect, thank you. And what does io.kotest.multiplatform?
s
you can stick wtih 5.2.3 for that, it hasn't changed
👍 1
If you can confirm it works @benkuly I will release 5.3.0
b
Yes it works, thanks. Sadly I have nested tests and therefore all tests are failing on JS 😕
s
they worked before ?
or is this a new project
b
nope. added js as target recently.
p
Nested JS tests are not supported
s
ahhh I see
Yeah you can't use nested JS tests because the JS frameworks don't support parent tests as async
b
Yes, already saw that... 😞
p
Hey! I just wanted to confirm that the JS-test are running fine again for all of my projects. Thanks @sam and all the others in this thread!
❤️ 2