https://kotlinlang.org logo
#kotest
Title
# kotest
p

peekandpoke

04/18/2022, 8:12 AM
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

sam

04/18/2022, 8:33 AM
It seems like something broke in 1.6.20
p

peekandpoke

04/18/2022, 8:40 AM
So am I not the only one with this issue?
s

sam

04/18/2022, 8:46 AM
@Jim has it too I think
j

Jim

04/18/2022, 4:12 PM
Yeah 😔 I abandoned updating to .20 for now
s

sam

04/18/2022, 4:24 PM
If you can track down the issue @Jim I might be able ot fix
p

peekandpoke

04/18/2022, 4:59 PM
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

sam

04/18/2022, 6:20 PM
Yeah I think that sounds like the issue.
the compiler plugin places all the specs into a val
j

Jim

04/18/2022, 6:30 PM
Now that you mention it I read in the either #javascript or #react that JavaScript wasn't auto running
p

peekandpoke

04/18/2022, 8:20 PM
Should I create an issue in kotest/kotest? @sam
s

sam

04/18/2022, 8:27 PM
pls
p

peekandpoke

04/18/2022, 9:32 PM
Or should I go into more detail in the issue description?
s

sam

04/18/2022, 9:57 PM
That's good
j

Jim

04/26/2022, 9:16 PM
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

sam

04/26/2022, 9:45 PM
Yeah but seems to be native only? Unless they just haven't updated the docs yet
j

Jim

04/26/2022, 9:46 PM
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

sam

04/26/2022, 9:49 PM
the compiler plugin prob
s

sam

04/26/2022, 11:35 PM
maybe its a new thing generated by the js compiler
j

Jim

04/27/2022, 7:05 PM
ok I'm not able to import that annotation, so we might just be dead in the water here 🤔
p

peekandpoke

04/28/2022, 6:41 AM
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

sam

04/28/2022, 1:58 PM
Can try it
j

Jim

04/28/2022, 4:55 PM
I'll try to include that in my annotation change
I'll try to get a PR out over lunch
❤️ 1
s

sam

04/30/2022, 5:02 PM
j

Jim

04/30/2022, 5:50 PM
Sam is the fastest 🙏
p

peekandpoke

04/30/2022, 11:45 PM
🦜
b

benkuly

05/01/2022, 9:36 AM
Will there be a release soon or is there a way to use the snapshot builds of the plugin?
s

sam

05/01/2022, 3:25 PM
today probably, I'm trying to get the intellij plugin working so that we can run individual JS / Native tests
👍 1
b

benkuly

05/02/2022, 1:13 PM
Until the release: Are there snapshot builds of the plugin? I saw, that there are oss snapshots, but what is the plugin naming?
s

sam

05/02/2022, 1:13 PM
This isn't a plugin thing, you can use the latest kotest snapshot
b

benkuly

05/02/2022, 1:13 PM
I thought for JS we need the multiplatform plugin?
s

sam

05/02/2022, 1:14 PM
it's all controlled by the main kotest library
Try 5.3.0.968-SNAPSHOT
b

benkuly

05/02/2022, 1:15 PM
Perfect, thank you. And what does io.kotest.multiplatform?
s

sam

05/02/2022, 1:15 PM
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

benkuly

05/02/2022, 3:38 PM
Yes it works, thanks. Sadly I have nested tests and therefore all tests are failing on JS 😕
s

sam

05/02/2022, 3:59 PM
they worked before ?
or is this a new project
b

benkuly

05/02/2022, 3:59 PM
nope. added js as target recently.
p

peekandpoke

05/02/2022, 3:59 PM
Nested JS tests are not supported
s

sam

05/02/2022, 4:00 PM
ahhh I see
Yeah you can't use nested JS tests because the JS frameworks don't support parent tests as async
b

benkuly

05/02/2022, 4:04 PM
Yes, already saw that... 😞
p

peekandpoke

05/05/2022, 6:10 PM
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
41 Views