Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Testing React Onsen Apps
-
I’ve been doing tons of research online to see if anyone has gotten jest+enzyme working in an onsen+react context. So far I haven’t found any articles with the magic bullet as of July 2018. I’m still experiencing the “Invalid State” error on importing onsenui or finding window.document to be undefined.
Has anyone gotten this working either using undom as Fran recommends below or another solution?
Re: How are you testing React Onsen Apps?
I attempted the recommendation in this SO thread as well and that didn’t make window.document available to reoct-onsenui when it was imported either at this point:
SO: react onsenui mocha test error “Error: Invalid state”
I would be grateful to hear any recommendations / experiences of others. Thanks!