This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-10
Channels
- # admin-announcements (1)
- # alda (1)
- # bangalore-clj (1)
- # beginners (94)
- # boot (139)
- # braveandtrue (1)
- # cider (19)
- # cljs-dev (21)
- # cljsjs (8)
- # cljsrn (79)
- # clojure (124)
- # clojure-austin (1)
- # clojure-belgium (1)
- # clojure-berlin (3)
- # clojure-hamburg (3)
- # clojure-quebec (1)
- # clojure-russia (77)
- # clojure-spec (5)
- # clojure-uk (18)
- # clojurescript (39)
- # conf-proposals (21)
- # core-async (5)
- # cursive (8)
- # datomic (40)
- # defnpodcast (1)
- # devcards (14)
- # dirac (5)
- # editors (1)
- # emacs (4)
- # jobs (1)
- # liberator (4)
- # onyx (29)
- # perun (15)
- # proton (15)
- # protorepl (9)
- # re-frame (47)
- # reagent (38)
- # ring (1)
- # rum (7)
- # specter (23)
- # untangled (8)
- # yada (55)
Has anybody figured out how to run CLJS tests on emulator/device? I’m using doo as a test runner and eventually solved it with couple of my own custom tools (like https://github.com/artemyarulin/koh/blob/93cf22ea5e3d89a6a2b410741d186c000d3c3408/kohRN/kohRNTests/kohRNTests.m#L12-L30), but I do believe that nowadays there should be a better way
@artemyarulin: Seems testing is not really a priority at facebook. I am testing my re-frame logic and has worked with react-native-mock
to test the components in node. Works alright.
Yeah, I’m testing my own logic with Node (and Planck) nowadays. But sometimes I want to check that actual IO works, maybe some rendering tests, etc. you know.
They have something now - https://facebook.github.io/react-native/docs/testing.html#integration-tests-ios but I’m not sure that I need all this
something for android as well https://github.com/facebook/react-native/blob/master/scripts/run-android-local-integration-tests.sh
@artemyarulin: Yeah I’ve thought some about testing in RN. And ultimately I figured that if my components render without a javascript error (even though I can not verify that they look aright) and my subscriptions and handlers work the way they should then I should avoid the majority of the bugs I’ve encountered so far at least. But som real integration tests would be sweet...
Yeah but it is amazingly poorly documented so without knowing what they are thinking its quite hard to achieve productive results...
Indeed
I did a minimal repo with integration testing but abandoned it for now: https://github.com/vikeri/rn-integration-tests
oh that’s super cool - so does it work already? Why you’ve abandoned it?
What I did was just to isolate out the examples from their own repo, I couldn’t get it to do much more tricks and I’m very much a beginner in Obj-C so the effort of making it something useful overweighed the value of it (for now).
ah ok, got it
It’s not as easy to run xcode on CI either, so that was a minus in the usefulness as well. (Using Gitlab CI)
yep, I’ve been developing for IOS for 5 years already - and XCode with CI is a constant pain. Thank you for your repo, I’ll spend couple of hours with testing, maybe I’ll figure out some easy way
@boorad: this is in the Troubleshooting Guide: https://github.com/mjmeintjes/boot-react-native/wiki/Troubleshooting
@boorad: did you try patching your react-native as explained there?
@pesterhazy: I’m getting this error in boot: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact mattsum:boot-react-native:jar:0.3-SNAPSHOT in clojars (
No idea if it works with RN, but I just attended a talk on iOS testing where this guy did 2 months of research and he recommended Calabash. http://calaba.sh/
As far as I remember it’s about UI testing first of all. in RN world there is snapshot testing which is also quiet interesting https://facebook.github.io/jest/blog/2016/07/27/jest-14.html
@seantempesta, @artemyarulin: both very interesting
@vikeri: did you get it to run?
@pesterhazy: Not running yet, how do I add dev deps? Tried
(set-env! :dependencies #(conj % [binaryage/devtools "0.7.2"]))
I think there's a '
missing before the vector?
@pesterhazy: Following your blog post and copying the files from the example app I have now successfully transitioned from re-natal to boot-react-native 🎉 runtime error stacktraces with source maps, here I come!
note that I disabled source maps in the latest version because it slowed down things quite a bit
I'm sure there is a relatively straightforward way to put them back in
you can, however, click on the stacktrace in the red screen, and the packager will open an editor in the terminal window
that's a bit weird, but super helpful for browsing the stack traces
with optimizations none, you can read the clojurescript compiler output pretty well
here's the issue for tracking sourcemap work: https://github.com/mjmeintjes/boot-react-native/issues/58
Hmm, it would be nice to have a switch, so that I could turn sourcemaps on when I run into an error but off otherwise
is source maps really helps? I’m using optimization none during development and I’ve never actually thought about source map
I think sourcemaps are a really nice feature and we should get them back
there are two places that need to be fixed in the code
agree that it would have been better to hide the feature behind a switch
@vikeri: added your suggestion to the gh issue
Hmm, having problems with require
not finding node modules when I’m trying to get my tests to run. Any ideas?
what's the error message?
Before I only had (def react-native (js/require "react-native-mock”))
but I changed it to (def react-native (js/require "react-native-mock/mock.js”))
1. restart the app (not relying on boot-reload)
2. clearing the packager cache (react-native start --refresh-cache true)
3. check the bundle output (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&hot=true)
But the packager should not even be involved. I am directly testing my js file with node
check if it properly found the require statement
hm that's a pretty unusual use case
I'd be curious if you can make that work (essentially run the output in node)
I did that, I required babel, mocked out react-native and then all business logic works. I even managed to sort of test my components using enzymes render
function.
Yeah it is quite neat to be able to run it purely on node. Works well with CI and it is very fast.
so am I hearing this right that this works with the cljs compiler output?
and node replaces the rn packager?
sweet
The problem was that I had moved the node_modules
into the directory app. I created a symlink from the root folder and then the tests worked with leiningen again.
careful with symlinks, they confuse the RN packager terribly
If I want to use re-natal
& react-native-navigation
, any additional work shoud I do besides those steps in react-native-navigation
's tutorial?
(def Navigation (aget (js/require "react-native-navigation") "Navigation"))
(defn init-nav []
(let [app-root (r/reactify-component app-root)]
(.registerComponent Navigation "app-root" (fn [] app-root))
(.startTabBasedApp Navigation
(clj->js
{:tabs [{:label "One"
:title "Screen One"
:screen "app-root"}]}))))
(defn init []
(dispatch-sync [:initialize-db])
(init-nav))
I modify code to this, after success react-native run-ios
and lein figwheel ios
, my figwheel forever waiting for connection, and there's nothing in my app.@pesterhazy: It has been patched.
Adding /Users/brad/.boot/cache/tmp/Users/brad/dev/clj/boot-react-native/example/1lnb/z4oa8w to fileset
Yup, in app/build
Maybe try clearing the packager cache
Otherwise you could try checking the bundle produced