rn-firebase-bridge icon indicating copy to clipboard operation
rn-firebase-bridge copied to clipboard

How to test rn-firebase-bridge

Open pietgk opened this issue 9 years ago • 4 comments

Hello,

I am wondering if anyone has a good idea on how to test rn-firebase-bridge.

My app test environment uses mocha, chai, enzyme in a node.js environment.

With now the need to test javascript, swift and java code this no longer can be easily used for all tests.

For now i use hard coded javascript test's code called from a separate test class optionally called from my app at startup (very basic console.log context to get started).

Before this slowly evolves into a test framework i could use ideas/experience from others.

Thanks Piet.

pietgk avatar Jul 18 '16 13:07 pietgk

Hi Piet,

I ignored this when I started as I had no idea how to approach testing things across the bridge.

The testing page mentions integration tests but I haven't yet looked into it further.

davecoates avatar Jul 20 '16 10:07 davecoates

I've started looking at how this might be done - one option is Appium.

See https://github.com/taskrabbit/ReactNativeSampleApp for example setup

Haven't tried anything yet but seems like a viable option. Kinda awkward in that you would have to setup views to render something based on what you are testing and validate that rather than asserting something directly in the code.

davecoates avatar Jul 21 '16 12:07 davecoates

I used https://github.com/user4815162342/simple-test-framework as a starting point. changed it to be react-native ok currently only as a local dir in my project (no npm yet). If you are interested i can share the code.

pietgk avatar Aug 19 '16 08:08 pietgk

Hi Piet

I'd be interested in seeing how you are actually using that to test the native code over the bridge (assuming that's what you are doing?)

davecoates avatar Aug 25 '16 19:08 davecoates