does anyone have any clue what could be causing my...
# kotest
s
does anyone have any clue what could be causing my tests to fail in such a way that there is actually just zero useable information on what caused them to fail? to reproduce, clone this repo and checkout commit
a809fe13
.
s
looks like node isn't even starting up properly to run the tests
s
yeah, but I have no indication as to why, so idk where to even start with identifying the issue
s
M2 is quite early in the new JS journey. Is it easy for me to add d8 to test these things?
I'm not that familar with wasm yet
s
I'm currently using M1 due to other issues with M2 (see previous message in kotest channel) but if you want to test this, just clone the repo. currently, the latest commit is the commit with the issue
s
ok I'll clone it
what do you need the stable id for ?
trying not to expose too much of the internals
btw, if you go to #CSYLDDZUY you can see the latest JS support that'll be in 6.0 final - nested tests, and full engine support for all features
(but it's a hacky branch atm)
s
I need a stable id because you can't have nested tests in js, so I'm currently using the following hack instead:
Copy code
context(context) {
    precomputed.forEach {
        withClue({ getStableIdentifier(it) }) {
            resultFunction(it.first, it.second) shouldBe (it.result plusOrMinus DEFAULT_TOLERANCE)
        }
    }
}
to replace
Copy code
context(context) {
    withData(precomputed) {
        resultFunction(it.first, it.second) shouldBe (it.result plusOrMinus DEFAULT_TOLERANCE)
    }
}
which is used on all other platforms
but once nested js tests are available, then I'd be able to avoid using this hack and just use
context
and
withData
on all platforms
s
ahhh makes sense
well you could use anything inside the clue
for now
s
I mean I'd prefer it to be a stable identifier, since these are my function signatures
Copy code
expect fun FunSpecRootScope.testPrecomputed(
    context: String,
    precomputed: List<FuzzyTestData>,
    resultFunction: (String, String) -> Double,
)

expect fun <T, U, V> FunSpecRootScope.testPrecomputed(
    context: String,
    precomputed: List<Triple<T, U, V>>,
    resultFunction: (T, U) -> V,
)
though as an implementation detail, I do currently know that the things passed into the first 2 generics of the tripple are strings and the last is always a
Pair<Int, Int>
, so I guess for now I could just use
.toString()
though I am currently trying to get this library ready for a release and would like to not be relying on things like that, even in the tests, at that point how long until nested test support will be released as a new milestone?
s
JS support will be M3, so as soon as I have it in a better place than "works on my computer"
maybe end of next week
really the only blocker right now is getting it work in browser tests without relying on mocha
the node support works fine
s
alright, epic
s
image.png
It'll be a huge boon to the ecosystem, as the kotlin.test support is pretty weak for KMP imo
the plugin will work with it too, so running single tests from intellij
s
yeah, mocha is kinda Something every time I run the tests, it always prompts me to enter the password to decrypt my keyring bc I'm on linux and for whatever reason, that's just what it decides to do
s
heh
I'm on linux too
s
did you attempt to build the repo I liked? and if so, did you experience an extremely long linking time for the linux x64 executable? because for me I was getting like >10 minutes on the linking time
s
not yet, it'll be this weekend before I can take a look in anger
on my work laptop atm
s
alright, just wanted to ask, bc having linking times that long was extremely odd and I wanted to see if someone else was able to reproduce or if it was just smth magical happening only on my computer
hi, any updates on this?
hey, going to bump this again in case it was missed.