Fork me on GitHub

does anyone have unit testing setup in a re-natal project?


@drhops: Haha just entered here to ask the exact same question.


@vikeri haha simple_smile glad i wasn’t missing something obvious


Some initial research got me to: You’ll want two kinds of tests: JS and Native. For JS we already have cljs.test and doo but I’m unsure how frictionless they can be used with RN. Jest or Mocha seems to be the most popular alternatives in the js community. A problem is that you have to emulate React Native with React. For Native there are heaps of options, Appium seems popular though. Not sure if this is a valid conclusion so please correct me if I’m missing something.


for unit test: Hardcore style: It is possible to run test on JavaScriptCore (this what RN on iOS is using). On Mac you can just run /System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc and try run tests on it. I guess it should be possible to install it on nix systems as well. Example is core.logic which runs tests on JSC as well (Github is slow currently) Casual style: Just run doo + node.js runner, with this you can even try to make IO, so kinda integration I hope somebody could give more info on UI/integration tests, I’m not aware


oh, forgot to mention - by unit tests I mean unit testing your logic, there is no way to load full RN environment to JSC binary


Great! Yeah the pure unit tests of functions seems very doable but the really interesting part is testing rendered components.


then I guess the good start would be figuring out how RN does it by itself. Later on just create a CLJS open source library and share it with us all simple_smile


Yeah for sure, the sad thing is that it does not seem to be a good consensus in the RN community. The official RN page on testing only supports iOS for example… But I’ll continue my investigations...


Could be, Android support in RN by itself is quite new


Somebody mentioned Rum here - what is the status with mobile support currently?