pixielabs / cavy

An integration test framework for React Native.
https://cavy.app
MIT License
1.37k stars 115 forks source link

Do nothing if testing is disabled #1

Closed jalada closed 5 years ago

TGPSKI commented 7 years ago

https://github.com/pixielabs/cavy/pull/20

This PR shows an example on how to implement this feature.

siddarthpatel commented 7 years ago

@TGPSKI Hey, I see you have experience with Cavy. Could you please tell me how I could disable the resetting of an app every time a test spec is completed? Thanks.

Megislava commented 5 years ago

Hi all! I possibly have the same question as some others. How can I develop w/o cavy doing tests? I have already separated production from cavy but I need to sepate testing the app with cavy and developing the app possibly with command. I hope that my question is understandable :)

jalada commented 5 years ago

@Megislava you have a couple of options. You can have two index.test.js and index.js files, and use some npm scripts to swap them in and out before running Cavy. Or you could have an entirely separate iOS/Android app within your XCode/Android Studio configuration which have different index.js entry files (this is what WatermelonDB do)

Does that make sense?

AbigailMcP commented 5 years ago

@Megislava - if you're using cavy-cli to run your tests, it now checks for the presence of an index.test.js file and, if present, uses this as the entry point to your app for testing purposes.

If you move all your test setup into index.test.js, you can then remove Cavy completely from index.js.

Hope this helps! I'm going to close this issue, but please let me know if you have any further comments / issues.