Join Slack
Powered by
I've mentioned this in a thread, but thought more ...
# react
e
epabst
08/01/2020, 4:55 AM
I've mentioned this in a thread, but thought more people might be interested. I've successfully written tests for a React component written in Kotlin. It uses Enzyme. Example test:
https://github.com/epabst/kotlin-showcase/blob/5d5129e556c8b168b0a0b838eec694664af37902/src/jsTest/kotlin/todo/ToDoScreenTest.kt
. The external bindings for enzyme are here:
https://github.com/epabst/kotlin-showcase/tree/5d5129e556c8b168b0a0b838eec694664af37902/src/jsTest/kotlin/enzyme
.
👍 2
a
andylamax
08/01/2020, 8:13 AM
wooow, thank you much much. I tried Enzyme back on 1.3.40, it got messy
r
Rob Murdock
08/03/2020, 12:30 PM
Oh I have lots of these if people are curious, using some minor sugar I’ve written for myself. My enzyme sugar is here:
https://github.com/robertfmurdock/testmints/blob/master/minenzyme/src/jsMain/kotlin/com/zegreatrob/minenzyme/EnzymeWrapper.kt
Rob Murdock
08/03/2020, 12:33 PM
example of usage
https://github.com/robertfmurdock/Coupling/blob/172416fa58e1aa20f9c454f1447938dba738274f/client/src/test/kotlin/com/zegreatrob/coupling/client/PrepareSpinTest.kt#L80
e
epabst
08/04/2020, 4:54 AM
@Rob Murdock
Very cool! I also like the idea of how you separated the tests into 3 sections.
☺️ 1
r
Rob Murdock
08/05/2020, 6:31 PM
That section thing is available as a library if you want to toy with that style
3
Views
Open in Slack
Previous
Next